Better HN
topnewbestaskshowjobs
Log inSign up

throwawaylinux

3,517 karma · joined Jul 23, 2021 (5y ago) · 2,823 submissions

Submissions

comment 4y ago · link · parent

The thread is referring to using two regular (glass) screens and folding those.

comment 4y ago · link · parent

Does your warranty period re-start when your device gets repaired or replaced?

comment 4y ago · link · parent

Or, Pournelle's iron law of bureaucracy.

The goal becomes less about doing things that benefit customers, and more about doing things that benefit the organization.

comment 4y ago · link · parent

That's fine the whole idea is weird anyway.

comment 4y ago · link · parent

Fold it the other way. Then you get your external screen thing for free.

comment 4y ago · link · parent

> I would also not expect replacement or repair for out of warranty devices, unless defective.

It sounds like it is defective.

comment 4y ago · link · parent

It's called the program-erase model. Some flash devices do expose raw flash, although it's then usually used by a filesystem (I don't know if any apps use it natively).

There's a _lot_ of problems doing high performance NAND yourself. You honestly don't want to do that in your app. If vendors would provide full specs and characterization of NAND and create software-suitable interfaces for the device then maybe it would be feasible to do in a library or kernel driver, but even then it's pretty thankless work.

You almost certainly want to just buy a reliable device.

Endurance management is very complicated. It's not just a matter of PE cycles for any given block will meet UBER spec at data retention limits with the given ECC scheme. Well, it could be in a naive scheme but then your costs go up.

Even something as simple as error correction is not. Error correction is too slow to do on the host for most IOs, so you need hardware ECC engines on the controller. But those become very large if you have a huge amount of correction capability in them so if errors exceed their capability you might go to firmware. Either way, the error rate is still important to know the health of the data, so you would need error rate data to be sent side-band with the data by the controller somehow. If you get a high error rate, does that mean the block is bad or does it mean you chose the wrong Vt to issue the read with, retention limit was approached, the page had read disturb events, dwell time was suboptimal, operating temperature was too low? All these things might factor in to your garbage collection and endurance management strategy.

Oh and all these things depend on every NAND design/process from each NAND manufacturer.

And then there's higher level redundancy than just per-cell (e.g., word line, chip, block, etc). Which all depend on the exact geometry of the NAND and how the controller wires them up.

I think better would be a higher level logical program/free model that sits above the low level UBER guarantees. GC would have to heed direction coming back from the device about what blocks must be freed, and what the next blocks to be allocated must be.

comment 4y ago · link · parent

https://data.worldbank.org/indicator/SH.MED.BEDS.ZS?location...

What we are witnessing is government that does not work for the good of the country and its people, but for the good of themselves and the special interests who bankroll them.

The healthcare system is perpetually run on the brink of disaster, but it turns out that it's everybody else's fault and therefore responsibility for preventing its collapse.

comment 4y ago · link · parent

> Yes, but copying a piece of software from a CD into program memory or onto my own hard-drive for archival purposes has been established as a fair-use exemption. So, if I legally acquire a copy of a program (say, I buy a CD), it can't impose extra restrictions after-the-fact through an EULA that only appears when I run it, and I am well within my rights to use my copy (e.g. by copying it into RAM/CPU icache to run it) even if I don't abide by the EULA, according to European Union jurisprudence.

We're talking about the GPLv2 though. It imposes no restrictions that copyright does not impose, so voiding the license is strictly a detriment to the licensee. The people who wrote it were very clever, using the power of copyright that is lobbied-for by the proprietary software industry.

comment 4y ago · link · parent

If the license is void then copyright law applies.

comment 4y ago · link · parent

Sure but at some other point in time Intel had a denser process and TSMC caught up despite Intel also improving, so that fact alone doesn't give you a lot of certainty about the future.

> Or is there any objective metrics to determine which one is better, other than MTr/mm2?

There are many, many objective metrics. Many are interdependent, many are tunable or selectable within certain ranges, many are in opposition, most are highly secretive, and all of them influence he type of device being made, the circuit design, logic, in different ways.

Even the experts with all the data for a particular technology and with a particular device in mind can't necessarily tell at a glance whether a change would be worthwhile. And even the meaning of worthwhile varies for the end-user of the device depending where their workload is. Make the middle-performing transistor slightly faster and leakier? Great you can close timing at a few ps faster but the device uses more power and is hotter, good for some customers bad for others.

Even simple density is not that simple in the fine details. Density can be in opposition to leakage, switching speeds, wire RC and propagation delay, etc.

There isn't an easy way to compare and there never will be.

comment 4y ago · link · parent

I'm not sure the facts really agree. Japan had its power structures destroyed and borders redrawn, so did India, China, Germany, Russia. Don't have to go back too far for that to have happened in most countries including all of Europe and the USA.

comment 4y ago · link · parent

I don't know much about it, but I'm interested to know why the space shuttle solid rocket boosters were so much more powerful than the F1 engine. 2 of them produced about 87% of the thrust of the 5 F1 engines on the Saturn V.

I thought combustion chamber instability was the biggest issue with the big engines. Are solid rockets much more stable?

comment 4y ago · link · parent

> By that logic, every time a programmer uses an inefficient data structure and introduces pathological performance it's not a bug, it's a "deliberate design choice".

Not if it's efficient for it's primary use cases. Lots of data structures have pathological behavior including in the Linux kernel.

comment 4y ago · link · parent

The logic is flawed though. You don't have the evidence or logic that it's certainly a bug or due to stupidity or oversight. I also don't know for certain that it's not which I'll acknowledge.

And if it was a strange forward map structure that takes a lot of time to flush but is fast or small or easy to implement, that actually supports my statement. That it was a deliberate design choice. Not a firmware bug. Gather delay was one example I gave, not an exhaustive list.

comment 4y ago · link · parent

> The article there cites per-kg costs at $10,000 on the space shuttle vs $27,000 on SpaceX. With the Dragon it came down to about $9,000 per kg, which is again about 10% below the price NASA was paying for the shuttle.

> Their own numbers say that in the fullness of time they may be 10% cheaper. So far, not so.

How do you reconcile these two statements? Are the costs now 10% cheaper per kg or not?

Also from the link 2

> Margasahayam points out that, while the space shuttles were more expensive — a whopping $500 million per launch (or possibly $1.5 billion, according to one analysis we've seen) — each mission carried about 50,000 lbs. (plus seven astronauts!). That means each pound of cargo used to cost about $10,000 to ship on a shuttle.

Some estimates are even higher than that, close to $2 billion, inflation adjusted

https://www.cnbc.com/2020/06/03/first-spacex-astronaut-launc...

So the low estimate is not really fair, SpaceX has to pay off their R&D costs as well.

comment 4y ago · link · parent

I thought the cost per launch for Starship was going to be even less than the non-heavy F9 because it's more reusable.

> The evidence for this is the relatively few Falcon Heavy launches we've had and are planned.

I don't think that's very good evidence. The first Falcon Heavy flight was only 4 years ago and there have been 3 launches until now. Presumably people design their missions around what's available and proven reliable so I would expect it to ramp up. Looks like there are 5/6 Falcon Heavy launches on the cards for this year.

comment 4y ago · link · parent

Ask them and see, I guess. There are software positions listed on their page.

comment 4y ago · link · parent

A good number of people who watched it go to the moon would have been around to hear about the Wright brothers' first powered flight (which only covered 1/3 the distance of the rocket's length). Technological progress from 1900 to 1970 would have just been mindblowing.

comment 4y ago · link · parent

Right, so you don't really know what it's doing at all. That it does something different is expected.

> Indeed, thus it's highly likely this is a dumb firmware bug, like the FLUSH implementation being really naive and nobody having cared until now because it wasn't a problem on devices where nothing flushes anyway. I don't think that's highly likely at all. I think it's highly unlikely.

> Yup, it's not rocket science, it's humans writing code. And humans write bad code. Apple engineers write bad code too, just take a look at some parts of XNU ;-)

I'm not some Apple apologist. I think their fsync() thing is stupid (although very surprised you didn't know about it and took you so long to check the man page, it's a old and well known issue and I don't even use or program for OSX). The hardware is clearly not very good for the task of a non-battery PC (even on batteries I think it's a questionable choice unless they can flush data in case of OS crash or low battery shutdown. I also think their kernel is low performing and a poor Frankenstein mishmash of useless microkernel bits. So you're not getting me on that one.

> Full flushes are rare on devices where the cache can be considered persistent anyway because there's a battery and the kernel is set up to flush on panics/emergency situations (which it is). Thus nobody ever ran into the performance problem, thus it never got fixed.

I never said the hardware was suitable for this type of operation.

> The dumbest cache implementation is a big fixed size hash table. That's easy to background flush incrementally on capacity, but then if you want to do a full flush you end up having to do a linear scan even if the cache is mostly empty.

I can think of dumber. A linked list you have to search.

This approach is really bad even if you don't have any syncs because you still want to place LBAs linearly even on NAND otherwise your read performance on large blocks

The fact you can come up with stupid thing that might explain it isn't a very good argument IMO. Sure that might be the case I didn't say it was impossible just didn't think it was likely. You're saying it's certainly the case. Don't think there's enough evidence, at best.

comment 4y ago · link · parent

> Nope, it's not a deliberate optimization / delay. Doing the flushes creates an extra ~10MB/s of DRAM memory traffic from the NVMe controller vs. not doing them while creating the same write rate.

How are you measuring that and how do you figure it means the NAND writes are not being held off? Clearly they are by one means or another.

> The firmware is doing something dumb when issued a flush command, it's not just sitting around and waiting.

> There's pretty close to 100% chance Apple would not have cared/optimized for this when designing this SSD controller, because it was designed for iOS devices which always have a battery, and where next to no software would be issuing flushes.

Yes. It is clear the hardware was never optimized for it. Because it is so slow. I'm almost certain that is a deliberate choice, and delaying the update is a possible reason for that choice. It's pretty clear the hardware can run this much faster, because it does when it's streaming data out.

NAND and the controller and FTL just isn't rocket science that you'd have hardware that can sustain the rates that Apple's can and then through some crazy unforeseen problem this would suddenly go slow. Flushing data out of your cache into the log is the FTL's bread and butter. It doesn't suddenly become much more complicated when it's a synchronous flush rather than a capacity flush, it's the same hardware data and control paths, the same data structures in the FTL firmware and would use most of the same code paths even.

Pull blocks from the buffer in order and build pages, allocate pages in NAND to send them, update forward map, repeat.

comment 4y ago · link · parent

tPROG is time it takes to program a NAND page from when you put the "program page" command on the pins to when you read off a successful status.

Some of the basic NAND guides they put out are simple enough to understand the basics of operation

https://www.micron.com/-/media/client/global/documents/produ...

The details get very complicated and proprietary. NAND wears out as you use it. But it also has a retention time. It gradually loses charge and won't read back if you leave it unpowered for long enough. This is actually where enterprise drives can be speced worse than consumer. So durability / lifetime is specified as meeting specified uncorrected error rates at the given retention period. The physics of NAND are pretty interesting too and how it translates into how a controller optimizes these parameters. Temperature at various stages of operation and retention changes properties, time between erase and program does too. You can adjust voltages on read, program, erase, and those can help you read data out or change the profile of the data. Reading can disturb parts of other pages (similar to rowhammer). Multilevel cells are actually interesting some of them you program in passes so that's a whole other spanner in the works.

I don't know of a good place that covers all that, but much beyond "read/program/erase + wear + retention" is probably beyond "what every programmer should know".

The way you turn a bunch of NAND chips that have a "read/program/erase" programming model into something that has a read/write model (the flash translation layer or FTL) is a whole other thing again though. And all the endurance management and optimization, error correction... Pretty fascinating details really. The basic details though is that they use the same concepts as the "log structured filesystem", turns out a log structure with garbage collection is about a perfect it for turning the program/erase model into a random write model. That's probably what every programmer should know about that (assuming you know something about LSFs -- garbage collection, write amplification, forward and reverse mapping schemes, etc).

comment 4y ago · link · parent

> No problem - sorry if i came off harsh, i thought you were being pedantic :D

No just I did a ctrl+F ctrl+C ctrl+V without thinking enough. No need to apologize though, my reply was actually flippant I should have been more respectful of your (correct) point.

> TBH, im not so sure its that different. Scanning through the linux docs it seems that this behaviour can be configured as part of mount options (e.g. barrier on ext4). At least its explicit on macOS (with compliant hardware).

I disagree (unless Linux short-cuts this by default). The reason is in the POSIX rationale:

*RATIONALE*

> The fsync() function is intended to force a physical write of data from the buffer cache, and to assure that after a system crash or other failure that all data up to the time of the fsync() call is recorded on the disk. Since the concepts of "buffer cache", "system crash", "physical write", and "non-volatile storage" are not defined here, the wording has to be more abstract.

The first paragraph gives the intention of the interface. It's clearly to persist data.

> If _POSIX_SYNCHRONIZED_IO is not defined, the wording relies heavily on the conformance document to tell the user what can be expected from the system. It is explicitly intended that a null implementation is permitted. This could be valid in the case where the system cannot assure non-volatile storage under any circumstances or when the system is highly fault-tolerant and the functionality is not required. In the middle ground between these extremes, fsync() might or might not actually cause data to be written where it is safe from a power failure. The conformance document should identify at least that one configuration exists (and how to obtain that configuration) where this can be assured for at least some files that the user can select to use for critical data. It is not intended that an exhaustive list is required, but rather sufficient information is provided so that if critical data needs to be saved, the user can determine how the system is to be configured to allow the data to be written to non-volatile storage.

Now this gives a rationale for why you might not include it. And lists three examples of where it could be valid to water down the intended semantics. The system can not support it; the functionality is not required because data durability is guaranteed in other ways; the functionality is traded off in cases where major risks have been reduced.

OSX on a consumer Mac doesn't fit those cases.

Linux with the option is violating POSIX even by the letter because presumably mounting the drive with -onobarrier does not cause all your applications to be recompiled with the property undefined. But it's not that unreasonable an option, it's clearly not feasible to have two sets of all your software compiled and select one or the other depending on whether your UPS is operational or not.

comment 4y ago · link · parent

I was asking about the context of the conversation. And I answered it for you. It's the likelihood of the risk. Two computers in two different locations can and do fail.

> You are wrong about that: Nobody cares if something is "designed to be durable according to the definition in the design".

No I'm not, that's what the word means and that's how it's used. That's how it's defined in operating systems, that's how it's defined by disk manufacturers, that's how it's used by people who write databases.

> That's just more weasel words.

No it's not, its the only sane definition because all hardware and software is different, and so is everybody's appetite for risk and cost. And you don't know what any of those things are in any situation.

> They care what are the risks, how you actually protect against them, and what it costs to do. That's it.

You seem to be arguing against yourself here. Lots of people (e.g., personal users) store a lot of their data on a single device for significant periods of time, because that's reasonably durable for their use.

comment 4y ago · link · parent

> There is a point at which a redundant array of inexpensive and unreliable replicas is more durable than a single drive. Even N in-memory databases spread across the world is more durable than a single one with fsync.

Unless a failure mode you are concerned about include being cut off from the internet, or your system isn't network connected in the first place, in which case maybe not eh?

Anyway surely the point is clear. "Durable" doesn't mean "durable according to the whims of some anonymous denizen of the other side of the internet who is imagining a scenario which is completely irrelevant to what I'm actually doing with my data".

It means that the data is flushed to what your system considers to be durable storage.

Also hardware failures and software bugs can exist. You can talk about durable storage without being some kind of cosmic-ray-denier or anti-backup cultist.

comment 4y ago · link · parent

The dirty secret about today's high density NAND is that tPROG is not fast. It's an order of magnitude slower than the heyday of SLC. Now that doesn't really matter for enterprise drives, they complete writes into very fast storage that is made durable one way or another (e.g., flush on power fail), and this small store gets streamed out to the NAND log asynchronously. This is why random single queue depth durable writes can actually be faster than reads on enterprise drives, because random reads have to come from NAND (tREAD is still very fast, just not as fast as writing to DRAM).

Apple may not implement such a durable cache, that's fine it's not an enterprise device and it's a cost tradeoff. So they might have to flush to NAND on any FUA, and that's slow as we've said, but not 25ms slow. Modern QLC NAND tPROG latency is more like 2.5ms-5ms, which could just about explain the EVO results when you include the OS and SATA stack and drive controller.

There's pretty close to 0% chance Apple would have messed this up accidentally though, in my opinion. It would have been a deliberate design choice for some reason. One possible reason that comes to mind is that some drives gang a bunch of chips in parallel end you end up with pretty big "logical" pages. Flushing a big logical page on a 4kB write is going to cause a lot of write amp and drive wear, so you might delay for a short period (20ms) to try pick up other writes and reduce your inefficiency.

1
575859
95