Linux 2.6.29
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Theodore Tso
OK, so there are a couple of solutions to this problem. One is to use ext4 and delayed allocation. This solves the problem by simply not allocating the blocks in the first place, so we don't have to force them out to solve the security problem that data=ordered was trying to solve. Simply mounting an ext3 filesystem using ext4, without making any change to the filesystem format, should solve the problem.
[...]
Quoted 6 lines
However, these days, nearly all Linux boxes are single user machines, so the security concern is much less of a problem. So maybe the best solution for now is to make data=writeback the default. This solves the problem too. The only problem with this is that there are a lot of sloppy application writers out there, and they've gotten lazy about using
fsync()where it's necessary;
The problem is not having accidential data loss because the inode /happened/ to be written before the data, but having /guaranteed/ data loss in a 60-seconds-window. This is about as acceptable as having a filesystem replace _any_ data with "deadbeef" on each crash unless fsync was called.
Besides that: If the problem is due to crappy VM writeout (is it?), reducing security to DOS level is not the answer. You'd want your fs to be usable on servers, wouldn't you?
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 19 lines · Theodore Tso
Quoted 8 lines · Matthew Garrett
Oh, for the love of a whole range of mythological figures. ext3 didn't train application programmers that they could be careless about
fsync(). It gave them functionality that they wanted, ie the ability to do things like rename a file over another one with the expectation that these operations would actually occur in the same order that they were generated. More to the point, it let them do this *without* having to callfsync(), resulting in a significant improvement in filesystem usability.There were plenty of applications that were written for Unix *and* Linux systems before ext3 existed, and they worked just fine. Back then, people were drilled into the fact that they needed to use
fsync(), andfsync()wan't expensive, so there wasn't a big deal in terms of usability. The fact thatfsync()was expensive was precisely because of ext3's data=ordered problem. Writing files safely meant that you had to check error returns fromfsync()*and*close().
Quoted 2 lines
In fact, if you care about making sure that data doesn't get lost due to disk errors, you *must* call
fsync().
People don't care about data getting lost if hell breaks lose, but they care if you ensure that killing the data happens, while keeping the data is delayed.
Or more simple: Old state: good. New state: good. Inbetween state: bad. And journaling with delayed data is exposing the inbetween state for a long period.
Quoted 7 lines
Pavel may have complained
thatfsync()can sometimes drop errors if some other process also has the file open and callsfsync()--- but if you don't, and you rely on ext3 to magically write the data blocks out as a side effect of the commit in data=ordered mode, there's no way to signal the write error to the application, and you are *guaranteed * to lose the I/O error indication.
Fortunately, IO errors are not common, and errors=remount-ro will prevent it from being fatal.
Quoted 5 lines
I can tell you quite authoritatively that we didn't implement data=ordered to make life easier for application writers, and application writers didn't come to ext3 developers asking for this convenience. It may have **accidentally** given them convenience that they wanted, but it also made
fsync()slow.
data=ordered is a sane way of handling data. Otherwise, the millions would change their ext3 to data=writeback.
Quoted 9 lines
Quoted 1 line
I'm utterly and screamingly bored of this "Blame userspace" attitude.
I'm not blaming userspace. I'm blaming ourselves, for implementing an attractive nuisance, and not realizing that we had implemented an attractive nuisance; which years later, is also responsible for these latency problems, both with and without
fsync()---- *and* which have also traied people into believing thatfsync()is always expensive, and must be avoided at all costs --- which had not previously been true!
I've been waiting ages for a sync() to complete long before reiserfs was out to make ext2 jealous. Besides that, I don't need the data to be on disk, I need the update to be mostly-atomic, leaving only small gaps to destroy my data. Pure chance can (and usually will) give me a better guarantee than what ext4 did.
I don't know about the logic you put into ext4 to work around the issue, but I can imagine marking empty-file inodes (and O_APPEND or any i~?) as poisoned if delayed blocks are appended, and if these poisoned inodes (and depending operations) don't get played back, it might work acceptably.
Quoted 2 lines · Bodo Eggert
data=ordered is a sane way of handling data. Otherwise, the millions would change their ext3 to data=writeback.
This one of the millions did that quite a while ago. Sanity be damned, my quality of life improved by doing so.
-Mike
Quoted 2 lines · Bodo Eggert
data=ordered is a sane way of handling data. Otherwise, the millions would change their ext3 to data=writeback.
See the discussion about defaulting to "relatime" (or my preferred, "noatime") mount option. It's a very sane thing to do, yet most people don't use anything other than the defaults. And now we're told even most distro's are hesitant to tweak tuning parameters away from the default.
- Ted
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines · Linus Torvalds
Quoted 1 line · Linus Torvalds
Yes, some editors (vi, emacs) do it, but even there it's configurable.
.. and looking at history, it's even pretty modern. From the vim logs:
Patch 6.2.499
Problem: When writing a file and halting the system, the file might be lost
when using a journalling file system.
Solution: Usefsync()to flush the file data to disk after writing a file. (Radim Kolar)
Files:src/fileio.c
Quoted 3 lines
so it looks (assuming those patch numbers mean what they would seem to mean) that '
fsync()' in vim is from after 6.2 was released. Some time in 2004.
Besides that, it's a fix specific for /journaled/ filesystems. It's easy to see that the same journal that was supposed to increase filesystem reliability is CAUSING more unreliable behavior.
Quoted 14 lines · Bodo Eggert
Quoted 13 lines · Linus Torvalds
Quoted 1 line · Linus Torvalds
Yes, some editors (vi, emacs) do it, but even there it's configurable.
.. and looking at history, it's even pretty modern. From the vim logs:
Patch 6.2.499
Problem: When writing a file and halting the system, the file might be lost
when using a journalling file system.
Solution: Usefsync()to flush the file data to disk after writing a file. (Radim Kolar)
Files:src/fileio.c
Quoted 7 lines
Quoted 3 lines
so it looks (assuming those patch numbers mean what they would seem to mean) that '
fsync()' in vim is from after 6.2 was released. Some time in 2004.Besides that, it's a fix specific for /journaled/ filesystems. It's easy to see that the same journal that was supposed to increase filesystem reliability is CAUSING more unreliable behavior.
Journaling is _not_ supposed to increase filesystem reliability.
It improves fsck time. That's it.
Actually ext2 is more reliable in ext3 -- fsck tells you about errors on parts of disk that are not normallly used.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 3 lines · Pavel Machek
Actually ext2 is more reliable in ext3 -- fsck tells you about errors on parts of disk that are not normallly used.
No. ext2 is not more reliable than ext3.
ext2 gets way more errors (that whole 5s + 30s thing), and has no "data=ordered" mode to even ask for more reliable behavior.
And even if compared to "data=writeback" (which approximates the ext2 writeout ordering), and assuming that the errors are comparable, at least ext3 ends up automatically fixing up a lot of the errors that cause inabilities to boot etc.
So don't be silly. ext3 is way more reliable than ext2. In fact, ext3 with "data=ordered" is rather hard to screw up (but not impossible), and the only real complaint in this thread is just the fsync performance issue, not the reliability.
So don't go overboard. Ext3 works perfectly well, and has just that one (admittedly fairly annoying) major issue - and one that wasn't really historically even a big deal. I mean, nobody really did fsync() all that much, and traditionally people cared more about throughput than latency (or at least that was what all the benchmarks are about, which sadly seems to still continue).
I do agree that "data=writeback" is broken, but ext2 was equally broken.
Linus
Hi!
Quoted 8 lines
Quoted 2 lines
Actually ext2 is more reliable in ext3 -- fsck tells you about errors on parts of disk that are not normallly used.
No. ext2 is not more reliable than ext3.
ext2 gets way more errors (that whole 5s + 30s thing), and has no "data=ordered" mode to even ask for more reliable behavior.
Quoted 8 lines
And even if compared to "data=writeback" (which approximates the ext2 writeout ordering), and assuming that the errors are comparable, at least ext3 ends up automatically fixing up a lot of the errors that cause inabilities to boot etc.
So don't be silly. ext3 is way more reliable than ext2. In fact, ext3 with "data=ordered" is rather hard to screw up (but not impossible), and the
Well, ext3 is pretty good, and if you have reliable hardware&kernel, so all your unclean reboots are due to powerfails, it is better.
If you have flakey ide cable, bad disk driver, non-intel flash storage
or memory with bit flips, you are better with ext2 -- it catches problems faster. Periodic disk check makes ext3 pretty good, unfortunately at least one distro silently disables. Pavel
--
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
2009/3/29 Pavel Machek <[email protected]>:
Quoted 1 line
Actually ext2 is more reliable in ext3 --
ext2 more reliable than ext3? Is this a joke?
ext2 is about 15 years and the worst linux file system ever. It´s slow, no journaling...
ext3 is fast, rockstable and solid.
I think ext4 is more reliable than ext3.
-
Morten
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 15 lines · Andrew Morton
On Thu, 26 Mar 2009 18:03:15 -0700 (PDT) Linus Torvalds
Quoted 8 lines · Andrew Morton
Quoted 2 lines
userspace can get closer than the kernel can.
Andrew, that's SIMPLY NOT TRUE.
You state that without any amount of data to back it up, as if it was some kind of truism. It's not.
I've seen you repeatedly fiddle the in-kernel defaults based on in-field experience. That could just as easily have been done in initscripts by distros, and much more effectively because it doesn't need a new kernel. That's data.
Quoted 4 lines
The fact that this hasn't even been _attempted_ (afaik) is deplorable.
Why does everyone just sit around waiting for the kernel to put a new value into two magic numbers which userspace scripts could have set?
Because the user controlling userspace does not understand your knobs. I want to say "file cache minimum 128 MB (otherwise my system crawls), max 1,5 GB (or the same happens due to swapping)". Maybe I'll want to say "start writing if you have data for one second of max. transfer rate" (obviously a per-device setting).
Quoted 2 lines
My
/etc/rc.localhas been tweakingdirty_ratio,dirty_background_ratioand swappiness for many years. I guess I'm just incredibly advanced.
These settings are good, but they can't prevent the filecache from growing until the mouse driver gets swapped out.
You happened to find good settings for your setup. Maybe I did once, too, but it stopped working for the pathological cases in which I'd need tweaking (which includes normal operation on my laptop), and having a numeric swappiness without units or a guide did not help. And instead of dedicating a week to loading NASA images in GIMP (which was a pathological case on my old desktop) in order to find acceptable settings, I just didn't do that then.