Better HN
topnewbestaskshowjobs
Log inSign up

throwawaylinux

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

Submissions

comment 3y ago · link · parent

> I worry about the pathological cases. Imagine you have an append-only log, and you write and fsync() one byte at a time. Each time you write a byte, the entire flash block (are they still 4KB these days?) has to be erased. So you end up chewing through 4000 durability cycles on your SSD, whereas if you had waited to write an exact 4KB block, then you'd use only 1.

NAND pages are what, something around 16-64kB these days, and block sizes are 10s of MB. In SSDs the logical size of those things may end up being larger at the FTL level if they are ganged together, but that's about your minimum.

Those are program and erase units respectively. With NAND, you do not erase a block to write. You can program pages in a block incrementally, and then you have to erase the entire block before reprogramming any.

Flash translation layers have to make this look like a disk. To do that they will do something like gather writes into a page size chunk in a small cache that is non-volatile or can persist itself on power failure. Then that chunk is programmed out to a free page. A mapping structure records the new NAND location of the logical block addresses you wrote. And a garbage collector comes along behind and compacts and frees data in block size units, erases them, and puts them on the free list.

It's a log structured filesystem with one file (the block device), if you've read any of those papers.

If you write+fsync to sector 0 of your disk 500 times, that data will get stored at 500 different places on the NAND (ignoring larger persistent caches in front of the NAND that some devices have). Selecting what pages to use and what to garbage collect etc is all part of wear leveling that is intended to prolong live of the drive. That's why endurance ratings tend to be in total writes to the drive, not writes to any particular sector.

To handwave the numbers, if you have a 100GB SSD that might be implemented with 105GB of NAND. Then if you had a program/erase endurance of 1,000 cycles you will be able to write that block 25.6 billion times. Your drive can do about 20-30 thousand QD1 writes per second, so about 12 days of that write+fsync block workload. Again assuming no front end cache on it.

You definitely can wear out NAND drives if you write a lot to them (large streaming writes would be easier to do it with), but regardless of what you do in the software layer, the drive will (should) last for its rated endurance no matter what kind of write patterns your application does. A block is a block as far as the NAND sees.

For consumer stuff you generally have to be pretty extreme or have malfunctioning software to wear them out as far as I've seen.

> A hard drive is fine with this access pattern, though you'd probably be doing a lot of seeking to update fs metadata and it would be so slow that you'd come up with some other way. So maybe this pathology only exists in my mind.

comment 3y ago · link · parent

> Has it occurred to you that most other places make barely any manufactured goods at all compared to China? Particularly basic materials like steel. How do you factor that into your calculations?

China looks terrible compared to almost all other significant economies. When fundamentals like electricity production are much dirtier, you don't need to look much further downstream.

> But it doesn’t matter regardless

What "doesn't matter"?

> because any attempt to impose authoritarian climate measures on China will send the West into economic crisis, one way or another.

International terms of trade can not be "authoritarian", by definition. That's an ironic misunderstanding: if you want authoritarian look no further than the communist dictatorship ruling the country.

comment 3y ago · link · parent

Key value FTLs have been around for about as long as FTLs. The logical block address -> NAND page forward map is just a key value store after all. It can potentially take one layer of indirection out of applications but you still have one there (the FTL). Or alternatively exposing the raw NAND and having the software manage it is another common way to go (indirection is in software now instead of hardware/firmware).

When I worked on FTLs it was always a thing executives and product managers liked to talk about but didn't seem to provide incredible results and people generally didn't like using them because it was just harder / different to manage. Has that changed?

comment 3y ago · link · parent

> I always worry that hardware "locks in" software. SSDs showed up after everyone wrote their databases to be optimal on spinning rust, so SSDs were built to look at the flow of requests, assume that the application was written for spinning rust, and optimize the data layout accordingly.

It's not really that so much as contiguous or nearby access is faster on NAND, just like it's faster on hard disks, so software optimized layout and access patterns can look similar for both.

> CPUs are similar. People started writing programs in C, so CPUs started optimizing for the outputs of C compilers.

This didn't start at a one-way street. Actually CPUs were around first, so the first C compiler optimized for the CPU it generated code for. And from that point onward, C compilers optimize for the CPU.

> If someone were to invent CPUs and compilers today, the list of optimizations would probably be different, and the performance characteristics of real-world software would probably be different. (It's not just C; people wanted virtual address spaces, and that was slow in software, so now there is a TLB, etc.)

Unlikely. At the periphery yes, but there are fundamentally difficult things for CPUs and compilers to do which shape the solutions. Before somebody says "those fundamental difficulties might be different if we invented things differently" - the story of CPUs and of compiler optimization is about inventing ways to make those fundamental difficulties less difficult.

There wasn't one day somebody invented the CPU and that was that, millions of people around the world have worked countless hours inventing and improving parts of CPUs and compilers for the past 70 years or so. There is inertia, but new ideas that are good enough can catch on even if it means entirely new models and ecosystems have to be invented. That's how we got multiprocessors, clusters, SIMD, GPUs.

comment 3y ago · link · parent

So you have no real argument.

comment 3y ago · link · parent

That didn't address what I wrote even if I was American, which I'm not.

While we're off on this wild tangent though, do you feel the same way about the hypocrisy of the ruling class. Do you think Barack Obama, Al Gore, Bill Gates, et al have "no right to complain" about emissions generated by us commoners?

Would that be a reasonable response for everybody, whenever a politician or elite says emissions need to be reduced? Stamp their feet and say no, because we deserve to emit as much as you do?

comment 3y ago · link · parent

You are the one trying to shift the narrative. I said nothing about per capita or not. I said emission intensity of production. That is a better metric IMO because it doesn't incentivize environmentally destructive population increase or excuse total emissions. It's basically the carbon efficiency of creating value.

It's not perfect, every situation is a bit different, but China is such a dirty outlier compared with other major economies and the world that you can't handwave it away - https://www.iea.org/data-and-statistics/charts/co2-emissions...

Producing something in China versus most other places means emitting more carbon.

comment 3y ago · link · parent

I don't quite understand what you're saying here. Somebody told you to eat bugs and you suggested they get rid of their gas stove for some reason. I don't quite see how it addresses what I or the original poster wrote.

For what it's worth, it's perfectly possible to be disillusioned and angry at the ruling class and their policies and their hypocrisy and profiteering at the expense of the environment, while also wishing for real uncorrupted environmental action. Some people are sick of it all and have given up on it. I place a lot more blame on the people who soured their attitudes.

comment 3y ago · link · parent

It's possible, but I don't think that would be assuming good faith or having a charitable interpretation of a comment.

FWIW I more often see the "eat the bugs" meme in response to obscenely rich elites and politicians advocating policies that require sacrifice from commoners.

comment 3y ago · link · parent

I will: per-capita is a terrible and compromised metric to use because it bears no relationship to the environmental cost of carbon, and it creates perverse incentives for regimes to maximize population and reduce living standards in order to maintain and increase their carbon emissions.

China's per-capita emissions aren't even great. Worse than many advanced economies.

comment 3y ago · link · parent

No "at least" about it. China has horrible carbon emission intensity of production. More than twice as bad as countries like USA, India, Japan, and more than 3 times as bad as cleaner ones. Not to mention all the other environmental problems they have.

comment 3y ago · link · parent

> The dismissal of environmentalists as "lol eat bugs" is really fucking sad, to me.

I don't see it as a dismissal of real environmentalists, more a laugh at the hypocrite corporatist ruling class who take their private jets and mega yachts to conferences where they pat one another on the back and tell everybody else to eat bugs. Them, and the army of sycophants and apologists who they've fooled.

comment 3y ago · link · parent

> Wow, not even Debian has done this. What a world in which RHEL is more adventurous than Debian.

Not even Debian has said they would remove it in a future release? I'm not sure what you mean here, Debian has a reputation for being glacial...

> So, is Wayland ready? I've been afraid to try it, but maybe it's time to take the plunge.

Yes, it's increasingly becoming the default on desktop distros, it's pretty good. Some apps still lack support for it I guess. I recently upgraded to a distro where it was enabled and didn't notice any difference except for a screen recording app didn't support recording with sound unless I switched to X.

> How is gaming on Wayland? I'm afraid many games have been compiled for X.org.

AFAIK such things just start under an Xwayland session transparently. Phoronix seems to do a lot of gaming tests of wayland, I don't really know the details but clearly something works for some games at least.

comment 3y ago · link · parent

Something something thunderous applause.

comment 3y ago · link · parent

> I imagine this sort of thing happened all the time.

Ah well that settles it then, nothing to see here, anybody who thinks or talks any further about it must be a crazy conspiracy cook.

comment 3y ago · link · parent

> These vilification are propaganda, likely covert operations from places like china or russia.

Source?

> The IMF is no saint, but they at least is looking to improve things, despite not acting altruistically.

Should I consider you likely covert operation from China or Russia because of the accusation that IMF is no saint and does not act altruistically?

comment 3y ago · link · parent

Even if you buy carbon neutral electricity, increasing the demand for it will end up increasing carbon positive electricity production (in the large scheme of things).

And we'll ignore carbon to manufacture the truck and create and maintain the roads, warehouses, and other transport infrastructure.

comment 3y ago · link · parent

If they are instead buying things with US dollars, where do those dollars come from?

comment 3y ago · link · parent

Aside from petroleum profiteers like Norway, Russia, Kuwait, etc., what countries don't run "systematic deficits"?

comment 3y ago · link · parent

Be careful what you wish for.

The majority of blue collar workers, as well as quite possibly the majority of people in many countries outside your own, might have very different views about things than you do.

comment 3y ago · link · parent

That's not the right phrase, it should be "annoys me no end".

comment 3y ago · link · parent

I'd love to know how that came up and who it was actually insulted you for speculating that. Are you talking people in the medical industry? Academia?

comment 3y ago · link · parent

Even mass surveillance of people who are Dangerous To Our Democracy™??

comment 3y ago · link · parent

I've worked with a couple of people in tech who were very worker solidarity, unionize, labor movement, discrimination everywhere, etc.

They must have been tiring for management to work with. And I go in to bat for my colleagues, and it has not always made me popular with management and executives, but there are better and worse ways of approaching things.

If you are unwilling to accept that a decision has been made for a reason other than discrimination, bullying, or retaliation, it's no longer a good faith dialogue. Expecting other parties to continue talking and negotiating as though it were, whether or not they are guilty of these things, is silly. That's the point where you need a lawyer, or an exit plan, or to read through a lot of statute and case law, or all of the above. By all means try to get them to keep talking and collect evidence, but the fact they don't want to deal with you any more isn't exactly evidence of anything by itself.

I'm not saying this person is wrong or did the wrong thing. I really don't have enough information. But this is a company that investigated their co-founder and CTO and kicked him out for harassing two trans employees, more than half their "leadership team" appear to be minorities or women, they have hired several trans people including at least one who got spectacular performance reviews and was being promoted. On its face I would have to entertain the idea that they are not engaged in wide scale discrimination of anybody who is not a straight white male.

This is also quite a serious step for the person to make, whether or not there are legal ramifications (and I hope they got very good advice about breaking their NDA). But what would an employer think about hiring this person after reading this? What would be the best outcome for them? The worst?

comment 3y ago · link · parent

"Helping the environment" does not just begin and end at banning things.

I would accept that logic from a well meaning child, but not a serious adult.

The obvious questions to any reasonable person would be, how much does this actually help the environment, what alternatives are there, and what might be the consequences of doing this. Banning straws never even got close to having good answers to any of these, and yet you were a dumb greedy redneck who hated the environment for pointing it out.

It's clear where the value for this came from, and that was as a tool to bash political opponents with.

Do you really not examine costs and benefits when you think about what motivates people?

comment 3y ago · link · parent

Well it certainly wasn't made to help the environment.

comment 3y ago · link · parent

I don't think it was ever thought at all. It was a device to find out who was with them, and to denounce the "anti-science bigots" who were against them.

comment 3y ago · link · parent

So... We're okay with questioning our Lord and Savior, the pharmaceutical and healthcare industries and regulators now?

comment 3y ago · link · parent

I don't know, people can have a genuine desire to improve things. I wasn't trying to call that out, just wondering what they expected might come of these ideas.
1
111213
95