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

Oh geez, deliberately issuing commands to storage after your kernel panics? It just keeps getting better :(

comment 4y ago · link · parent

What is the difference in the context of your comment? The likelihood of the risk, and nothing else. So what is the exact magic amount of risk that makes one thing durable and another not, and who made you the arbiter of this?

> No it does not. The drive can still fail after you write() and nobody will care how often you called fsync(). The only thing that can help is writing it more than once.

It does to anybody who actually understands these definitions. It is durable according to the design (i.e., UBER rates) of your system. That's what it means, that's always what it meant. If you really don't understand that, I have no idea what to say.

> The only thing that can help is writing it more than once.

This just shows a fundamental misunderstanding. You achieve a desired uncorrected error rate by looking at the risks and designing parts and redundancy and error correction appropriately. The reliability of one drive/system might be greater than two less reliable ones, so "writing it more than once" is not only not the only thing that can help, it doesn't necessarily achieve the required durability.

comment 4y ago · link · parent

Oh sorry you're right... Too much C, not enough POSIX.

Okay, so OSX is right by the letter of the standard. Not by the spirit though, when you look at the rationale for allowing the exception.

comment 4y ago · link · parent

> #define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */

comment 4y ago · link · parent

> No, not without that. Even with that, you can't have durable writes; Not on a mac, or linux or anywhere else, if you are worried about fsync()/fcntl+F_FULLSYNC because they do nothing to protect against hardware failure: The only thing that does is shipping the data someplace else (and depending on the criticality of the data, possibly quite far).

"The sun might explode so nothing guarantees integrity", come on, get real. This is pointless nitpicking.

Of course fsync ensures durable writes on systems like Linux with drives that honor FUA. The reliability of the device and stack in question is implied in this and anybody who talks about data integrity understands that. This is how you can calculate and manage error rates of your system.

comment 4y ago · link · parent

It seems to be pretty apples to apples, they're running the same benchmark using equivalent data storage APIs on both systems. What are you thinking might be different? The Linux+WD drive isn't making the data durable? Or that OSX does something stupid which could be the cause of the slowdown rather than the drive? Both seem implausible.

comment 4y ago · link · parent

OSX defines _POSIX_SYNCHRONIZED_IO though, doesn't it? I don't have one at hand but IIRC it did.

At least the OSX man page admits to the detail.

The rationale in the POSIX document for a null implementation seems reasonable (or at least plausible), but it does not really seem to apply to general OSX systems at all. So even if they didn't define _POSIX_SYNCHRONIZED_IO it would be against the spirit of the specification.

I'm actually curious why they made fsync do anything at all though.

comment 4y ago · link · parent

You have to know something about coherency. You don't need to know the details but you need to know that multiple processors can read a cache line, but if there are any writers there will be trouble.

You have to know something about consistency. You don't need to know the details but you need to know enough to know you don't know enough to write your own synchronization primitives or lock free algorithms, at least.

comment 4y ago · link · parent

Are most modern houses really too luxurious where you're from?

What I see is that they have pretty poor build quality when you look closely, and are thrown together as cheaply as possible, and are not designed all that well. Where I am, "marble" would be engineered stone (which I don't have a problem with it's functional and looks okay), but many new kitchens (and bathrooms) aren't well designed for the space they take up and come with flimsy gimmicky fittings and appliances.

Where modern houses go overboard (in my opinion) is optimizing floor area per dollar and making them very large and lowering quality. Although that's also a response to buyer preferences, people like having very big houses and don't care too much about the design, the details, or efficiency.

comment 4y ago · link · parent

The CPU core/cache uses its physical addresses to route loads and stores, but they don't have to go to the memory controller on the chip. They could go to the SMP unit if the memory controller for the data is on another chip. Or a PCI host bridge on the chip. Either directly to its register space, or to the register space or memory that belongs to a device behind it. These addresses are called "MMIO" memory mapped IO and are the way configuration is done. They are also slow, low bandwidth, synchronous.

x86 has "ports". I don't know about modern implementations but I would guess they are done with MMIO out the back end of the core (e.g., the CPU turns inb/outb instructions into accesses to special memory ranges).

Either way MMIO is the way to configure devices.

DMA is how to move data between device and CPU or devices. But nowadays with high performance devices, you don't set up a request and then send a MMIO command to process that request, and then get an interrupt and do a MMIO to get completion status of the command. The commands and completions themselves are DMA'ed. So you have ring buffers (multiple for a multi queue or virtualized device) for commands and completions which get DMAed. You do the MMIOs and interrupts only to manage starting and stopping (fill, empty, etc) conditions of the queues.

DMAs can go direct to caches in some architectures, but as I said L3 caches are only so large, and data volumes so large that it can be hard to arrange. You would hope your queues are mostly cached at least, but in reality I don't know if that actually happens well.

comment 4y ago · link · parent

It does. Outside of MMIO which nowadays is just the control plane for device configuration and the main processing state machines (e.g., starting and stopping processing of command and completion packets in ring buffers in memory). So those commands which are the primary control plane for the data operations are even all in memory! Then the data operations themselves are all memory too of course.

It is possible for the PCI host bridge DMAs to load and store into caches, but in practice it can be difficult if not impossible to line everything up so the data is in cache when it is required, because of the data throughput and pipelining (many parallel pipelines) latency variations even on local NAND devices, etc.

Maybe you get your command/complete rings from cache (which would be nice since they have to come in order and the CPU has to operate on), but it's very hard to get all your data served by the caches.

The old favorite netflix serving talks show this

https://people.freebsd.org/~gallatin/talks/euro2021.pdf

comment 4y ago · link · parent

It's also wrong about some basic details AFAIKS. A "memory controller" typically has more than one memory channels and not always ganged, so independent concurrent accesses even in a single controller can be supported. DRAM can also have multiple banks which can be accessed independently. So there is certainly not only one "bank" per north bridge or one bank per ODMC.

comment 4y ago · link · parent

It's sort of astounding that so much work has to be done to even get testing done. If it was well known that PFAS chemicals were used, surely testing would be prudent rather than just taking the word of the company (even if their claims that there were no spills in good faith and they weren't aware of contamination). Is testing really that costly?

> For every ex-company town that succeeds in this kind of recognition, there are ten others (usually, but not always, poorer and not as white) that are quietly suffering from externalized pollution.

This caught my eye. What's the evidence for this? Are you saying non-white people are less likely to engage in this type of civic action for some reason?

comment 4y ago · link · parent

> Hardware intellectual property has an insane number of working parts and "factors" (electrical resistance, photo-lithography, metal layers, silicon is amazing) all have to be solved.

Again, fabless companies don't have to do any of this. You get a PDK from the factory which provides all these parameters and even standard cell libraries so you don't even have to do circuit design. You just feed your logic into "compilers". You need "physical" designers to optimize the output of those stages, but these are not people looking at the physics, they just optimize P&R and floor plan according to the PDK specs and tool output basically to close simulated timing.

In practice once you get to a large enough and high performance product, you would need custom circuit designers. And step up even larger again and you'll likely be working directly with the manufacturer on defining and tweaking the process. At Apple scale, you probably even define your own custom process node. Once you get to this scale though it's pretty much like big software houses writing their own libraries or OSes or compilers or asm code because the standard available stuff is not quite enough. That all takes a lot of engineers too.

But that's not _required_ and almost certainly PA Semi would not have had a whole lot of engineers on that work, it would have been logic, analog, PD, V&V, power, primarily. And almost all would just work on the standard package they get from their fab. So mostly writing "software". And you don't need any money for a develop,release,iterate cycle on most of the hardware stack because it can be and is simulated.

comment 4y ago · link · parent

It was a fabless company so you basically write code and send it off to get built.

There's more details to it, but a single person could write a very small CPU and put it on an FPGA (or ASIC if they have the tools) in a few months.

That's just one example though. There's lots of software examples. Compilers, browsers, OS kernels, database servers, hypervisors. A single person can write any of those, but to make a competitive product it's often a very different story.

comment 4y ago · link · parent

Your comments are difficult for me to understand, although you do have a fun and whimsical style!

I wasn't taking it as gospel and I agree some engineering outfits are (or at least appear to be) overstaffed or inefficient, and a small number of very driven and talented people can produce some incredible things. But when it comes to making a product it can take a radically larger amount of engineering effort than it would appear.

PS Semi is an example of an ARM-beating company which was founded by a visionary engineer who almost certainly had the big ideas himself or within a small group of technical leadership. It still took a hundred engineers 4 years to bring out their first product.

comment 4y ago · link · parent

These "foundations" are very typical of rich people and politicians.

comment 4y ago · link · parent

> If you need more than two engineers + 2 assistants, you should have hired smarter engineers.

Oh, I half thought you were serious until this point. I still don't get the joke though.

comment 4y ago · link · parent

At some point after that, you'll realize that "leaders" and people who are seen to have the authority and capability to solve problems have a vested interest in perpetuating problems and making them worse.

comment 4y ago · link · parent

I don't know what your first paragraph means, what matched up?

I don't know what you mean by guardrail either. Vaccine trials were significantly accelerated from typical vaccines, long term data was foregone and emergency use authorizations were used to deploy them. I don't know what you're trying to argue or whether you're actually trying to deny that reality.

comment 4y ago · link · parent

> What vaccine guardrails are you under the impression were removed?

The guardrails that the typical trial process has, see e.g.,:

https://coronavirus.jhu.edu/vaccines/timeline

https://www.ncirs.org.au/phases-clinical-trials

> AFAIK none were removed, it's just steps were done in parallel at great $expense.

No, the far greater expense is the typical 5-10 years that clinical trials require.

> It appears you are trying to imply that it's fine if Tesla skips safety testing and pops a few skulls like watermelons in pursuit of $FSD. I'm not saying perfection is possible, but certainly Tesla can do better than it's doing. If anything, Tesla threatens to set everything back with its sloppiness. One bad accident could create enough bad PR to set self-driving cars back for years.

It doesn't appear that I'm trying to imply that at all, it appears you're just making things up.

comment 4y ago · link · parent

Right. What I want to know is, what was the basis for claiming all this would be so great in the first place? It appears to have been almost entirely free of any evidence, as far as I've been able to tell.

It's mind boggling to me when we see the kinds of people in the industry and their demands for data and evidence when it comes to other subjects.

comment 4y ago · link · parent

I don't believe I said anything was wrong with it or anything else there. Most of the things I listed have their uses. That was completely not my intention to say they're bad, I hope that's not the point people are getting from my post.

The point is how uncritically some of these things get taken, and how easily people will believe fantastic, unfounded claims. And not just a few gullible idiots, but huge swaths of academia and industry.

comment 4y ago · link · parent

I'm not sure that it is so bad.

But I still don't understand why it's good! Why is it so good? It is said to be better than (non-OOP) alternatives. Where's the evidence for that?

comment 4y ago · link · parent

I'm not making the claim though. I want to know what the data is for your assertion that OOP "makes a huge system manageable" in a way that other approaches or language features can not.

Mind you there are countless millions of lines of COBOL, C, etc out there in production so existence alone does not provide any evidence one way or another.

comment 4y ago · link · parent

> In practice, OOP basically exists to take some horribly messy program, put an interface around it, and make it slightly less terrible to deal with.

This is the sort of hype that has followed OOP around everywhere though. Well that's great, of course we would want to take a horribly messy program and make it less messy! Who wouldn't?

But where is the evidence that it actually performs as advertised? Does it make software easier to deal with? Is it superior to alternative ways to achieve that?

comment 4y ago · link · parent

Back in the 90s OOP was touted as revolutionary. The next big thing, would completely change programming. If something wasn't object oriented, it was looked down upon. SQL even got on the bandwagon. It was said that very complex inheritance structures, operator overloading, and all this other stuff would (somehow) make it far easier to write and understand complex projects. Many seemed to have taken and repeated this on faith and not much else. I'd never seen any real justification for these assertions, it was never explained to me why those things would perform as claimed with sound reasoning, let alone actual data.

Were there ever any real objective [hah] studies done about how much it improved software development? And did they show a significant improvement? Even if you're still pro-OOP today, you would have to admit it fell vastly short of its promises even if it does help a little bit.

Today it seems like there's been very little accountability or learning from all this. Some people have sheepishly climbed down off the bandwagon, but there's been very little overall reflection. I'm not talking about witch hunts -- there will always be more snake oil salesmen -- I mean learning as individuals and an industry to demand data and reason rather than handwaving and assertions. The sad thing too is that a lot of the baseless hype came out of academia too (microkernels are another one that comes to mind).

I still see this today. The new languages and language features. New database concepts like NoSQL. "AI". Blockchain. All the way down to the CPU (transactional memory, various "security" features, etc). Proponents can make extremely compelling-sounding cases for these things, and make it sound like they'll solve all the world's problems. And some may well turn out to be a net win in the end. But the only thing that actually matters is the real world results, and you can only evaluate that by studying the data.

In general, if something sounds too good to be true, it usually is. Maybe the incredible trajectory of the computing industry has dulled peoples' common sense when it comes to detecting this kind of hype. It's absolutely rife in the computing industry and academia.

comment 4y ago · link · parent

4000 people died, what I said is true.

102 deaths every day in the USA alone is staggering, and many children and young people! Are you trying to it's not? How many people has self driving cars and their research and development killed? Vanishingly few by comparison.

The situation is very analogous to covid and vaccines.

comment 4y ago · link · parent

> Do you think Google is being completely transparent with the public about things that are being said about Google Cloud in board meetings?

That doesn't follow. There is a big, big difference between not being completely transparent and making false or misleading statements to investors.

You said they've got no prospect of performance leadership and are going to focus on just getting the most out of their existing fabs. This is not a fact and not supported by their statements and actions so far. It's a wild guess and pretty unlikely to happen given their investment pipeline. Some time in the future, possibly. As a result of the circumstances right now when they are making money hand over fist with their leading edge nodes and building new fabs? No.

1
585960
95