Brendan wrote:Event logs are always stored in memory (and then synced to disk) to avoid lots of tiny writes.
For a "mostly intended for a single local user" OS, you'd add the event to the event log in memory, then (later) try to update the copy on disk; and in the rare and relatively irrelevant case that this happens to also be the disk that was removed (and there's no RAID or any other redundancy) it won't work, but it will work for all of the normal cases that matter (e.g. it wasn't the OS's primary/only storage device) and therefore it's highly important (despite not working properly for your irrelevant case).
Having the primary storage device fail is not "irrelevant". If any storage device fails, that's
by far the most likely. SSDs have a common, nasty, failure mode where they simply "cease to exist" without warning. Indistinguishable from an unplugging. Apart from that, booting from USB is very common these days, especially when people are "trying out" a new OS. In those cases, your event log has nowhere to go.
Brendan wrote:
For a "peer to peer distributed" OS (like mine), there is no "primary/only storage device" - there's just local copies/caches of a (logical, not physical) global file system.
How does one first set up this OS? Surely they'll be a state during the early set-up process where the "distributed" OS only has one node, before others join the "cluster"? What happens if one node loses connectivity? Does it have a "degraded" state where it might still be generating data that's not (at that time) being replicated anywhere?
Brendan wrote:
For a "cloud OS" (like the original poster's), there's probably some kind of "management computer" on the network
I believe I covered that case when I said that you could send your event log out over the network. However, the "infrastructure" problem still exists, since you have to keep the entire network stack, configuration, "logging daemon", etc. in non-swappable memory at all times. If you've got plenty of memory and have written efficient code, that might not be too much of a problem, but it's an awful lot of stuff to "special case".
Brendan wrote:
Almost all of the servers here have "hot plug drive bays" in the front of their cases. Most of them are SATA (the oldest ones are some sort of "parallel SCSI").
For servers, you have nothing to worry about; no competent server administrator is going to unplug a storage device without first "unmounting" it (or they won't do it twice at least!). Many such bays even have electromechanical locks to prevent it.
Hot-unplugging at a bad time is only a serious concern for user systems.
Brendan wrote:
From those benchmarks (the difference between "no TRIM,used state" and "TRIM enabled, used state", for every single graph on that page) it's obvious that TRIM improves performance by about 10%.
The actual percentage improvement for each graph is is: 9.7%, 8.8%, 2.3% and 1.4%. The first two are maybe "about 10%", but the other two are far smaller. While averaging percentages is not really mathematically sensible, the overall improvement is probably around or below 5%. Considering the downsides of TRIM, it's barely worthwhile. Spending an extra $10 on a slightly more expensive SSD will likely give better results than messing around with TRIM.
Brendan wrote:the terrorists
What "terrorists"? I specifically mentioned "authorities". Your statements about security/privacy make it pretty clear that no sensible person should ever trust your code.
Brendan wrote:deluded "tin-foil-hat-wearing crackpots"
There's very little reason not to have your filesystem encrypted in 2017. Unless you really need absolute maximum performance (the performance hit of a well-implemented encryption layer is of the order 1-2%) or have critical data that's not backed up (in which case, you're an idiot), there's no benefit to storing data in plaintext.
Brendan wrote:you're claiming that SMART is always 100% useless
I specifically said it's best to "err on the side of caution and display a warning". That's explicitly
not claiming that it's "always 100% useless". Don't put words in my mouth (on my fingers?). It's a nice idea and a useful
indicator that something
might be wrong. Beyond that it's "half a standard" and impossible to get "concrete answers" from.
Brendan wrote:Like I already said, SMART has nothing to do with errors that have occurred (it's about predicting errors that have not occurred yet).
You already said? When? Here's what you
actually said, for reference:
Brendan wrote:handles SMART and all possible kinds of errors and drive failures
If a failure has already occurred, it's by definition too late to "handle" it. Telling a user "your hard drive has failed" isn't "handling" anything; it's just admitting (inevitable) defeat.
Brendan wrote:
The problem is that a file system says "write W, X, Y and Z; but make sure that W is written successfully before you write Y (because Y is the metadata for W), and make sure that X is written successfully before you write before Z (because Z is metadata for Y); but to improve performance feel free to write W and Y in any order you like, and feel free to write X and Z in any order you like".
There's a mistake here; "free to write W and Y in any order you like" contradicts "make sure that W is written successfully before you write Y"... I think you've swapped X and Y in the second half of the paragraph; "X is written successfully before you write before Z (because Z is metadata for Y)".
I believe a priority system handles this; you simply set the "data" writes to be a higher priority than the "metadata" writes. Both "data" writes have the same priority (so can be written in the most performant order), as do both "metadata" writes.
You do end up with an overly-strict ordering in which
all queued "data" writes get written before
any "metadata" writes. To solve the potential problem that in a busy system "metadata" writes may
never happen, you can have a system that increases the priority of writes based on the number of "queue cycles" they've been waiting for. Assuming that you never issue a write to metadata before the write to data (i.e. it's never been waiting for more queue cycles than its corresponding data write), the ordering requirements still hold.
Simple, straightforward and no need for "global sync" or an overly complicated separation-of-concerns violating hardware driver.