Re: msync() behaviour broken for MS_ASYNC, revert patch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds wrote:

On Fri, 10 Feb 2006, Nick Piggin wrote:

This is a Linux implementation detail. As such it would make sense to
introduce a new Linux specific MS_ flag for this.
..
Definitely. And when the app gives us a hint that it really wants the
data on the disk, starting it as early as possible is also a good
optimisation.


But that's what MS_SYNC is. MS_SYNC says "I need this data written now".


Yes but it is synchronous.

MS_ASYNC moves it into the page cache. That makes 100% sense. Then it will be written by the regular dirty page writeout. That makes 100% sense.

MS_INVALIDATE does that (in Linux), the spec is poorly worded but the
intention seems to be that it would push dirty state back into pagecache for
implementations such as ours.


I don't think there's anything wrong with your fadvise additions.
I'd rather see MS_ASYNC start IO immediately and add another MS_
flag for Linux to propogate bits.


Why? I miss the _reason_ you want to do this.


[email protected] has an application (database or logging I think), which
uses MS_SYNC to provide integrity guarantees, however it is possible to do
useful work between the last write to memory and the commit point. MS_ASYNC
is used to start the IO and pipeline work.

The current MS_ASYNC behaviour is the sane one. It's the one that doesn't cause the harddisk to start ticking senselessly. It's the one that allows a person on a laptop to say "don't write dirty data every 5 seconds - do it just every hour".


MS_INVALIDATE

In contrast, _your_ proposal is just inflexible and inconvenient.


Currently MS_ASYNC does the same as MS_INVALIDATE. But it used to start
IO (before 2.5.something), and apparently it does in Solaris as well.

If somebody really really wants to "start flushing data now", then he can do so, but that actually has absolutely zero to do with "msync()" any more. A person who wants the flushing to start "now" might want to flush any random dirty buffers.


I didn't quite understand what you're saying here.

Your suggestion is no different from saying "we should make every 'write()' call start the IO". Which is obviously crap.


I think it is quite a bit different. Obviously what you're saying is crap,
but I think there are good arguments for changing MS_ASYNC so it is not
quite so obvious.

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux