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

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

 




On Fri, 10 Feb 2006, Trond Myklebust wrote:
> > 
> > Now, in a _coherent_ environment (like Linux) it should probably be a 
> > no-op, since the mapping is always consistent with storage (where 
> > "storage" doesn't actyally mean "disk", but the virtual file underneath 
> > the mapping).
> 
> Hmmm.... When talking about syncing to _permanent_ storage one usually
> is talking about what is actually on the disk.

Ok, in that case Linux has never done what MS_INVALIDATE says, and I doubt 
anybody else has either. It's neither sane nor even really doable (you'd 
have to yank out everybody _elses_ caches too, not just your own).

So I think that within this context, the "permanent storage" really means 
the "file" that is mapped, and doesn't care about whether it has actually 
hit the disk yet.

> In any case, we do have non-coherent mmapped environments in Linux (need 
> I mention NFS, CIFS, ... ;-)?).

Good point. That's an argument for actually dropping the local page cache 
entirely on such a filesystem, since such a filesystem really isn't 
fundamentally coherent.

However, that would be some really _nasty_ semantics, because it would 
mean that something like NFS would behave very fundamentally differently 
than a local filesystem, even if the user only actually uses it on the 
local machine and there are no other writers ("..but there _could_ be 
other writers that we don't know about").

So I'd have to veto that just on the grounds of trying to keep users sane.

> IIRC msync(MS_INVALIDATE) on Solaris was actually often used by some
> applications to resync the client page cache to the server when using
> odd locking schemes, so I believe this interpretation is a valid one.

I think you're right. Although I would also guess that 99% of the time, 
you'd only do that for read-only mappings. Doing the same in the presense 
of also doing writes is just asking for getting shot.

Even for read-only mappings, it's actually quite hard to globally flush a 
page cache page if somebody else happens to be using it for a read() or 
something at exactly the same time.

		Linus
-
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