|| ||Linus Torvalds <torvalds-AT-linux-foundation.org> |
|| ||Alan Cox <alan-AT-lxorguk.ukuu.org.uk> |
|| ||Re: Linux 2.6.29 |
|| ||Fri, 27 Mar 2009 11:05:58 -0700 (PDT)|
|| ||Matthew Garrett <mjg59-AT-srcf.ucam.org>,
Theodore Tso <tytso-AT-mit.edu>,
Andrew Morton <akpm-AT-linux-foundation.org>,
David Rees <drees76-AT-gmail.com>, Jesper Krogh <jesper-AT-krogh.cc>,
Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>|
|| ||Article, Thread
On Fri, 27 Mar 2009, Alan Cox wrote:
> The kernel cannot tell them apart, while fsync/close() as a pair allows
> the user to correctly indicate their requirements.
Alan. Repeat after me: "fsync()+close() is basically useless for any app
that expects user interaction under load".
That's a FACT, not an opinion.
> For an event driven app you really want some kind of threaded or async
> fsync then close
Don't be silly. If you want data corruption, then you make people write
threaded applications. Yes, you may work for Intel now, but that doesn't
mean that you have to drink the insane cool-aid. Threading is HARD. Async
stuff is HARD.
We kernel people really are special. Expecting normal apps to spend the
kind of effort we do (in scalability, in error handling, in security) is
just not realistic.
> Agreed - which is why close should not happen to do an fsync(). That's
> their problem for writing code thats specific to some random may happen
> behaviour on certain Linux releases - and unfortunately with no obvious
> cheap cure.
I do agree that close() shouldn't do an fsync - simply for performance
But I also think that the "we write meta-data synchronously, but then the
actual data shows up at some random later time" is just crazy talk. That's
simply insane. It _guarantees_ that there will be huge windows of times
where data simply will be lost if something bad happens.
And expecting every app to do fsync() is also crazy talk, especially with
the major filesystems _sucking_ so bad at it (it's actually a lot more
realistic with ext2 than it is with ext3).
So look for a middle ground. Not this crazy militant "user apps must do
fsync()" crap. Because that is simply not a realistic scenario.
to post comments)