Re: Problem with msync system call

From: Andi Kleen (ak@suse.de)
Date: Tue Jul 23 2002 - 13:06:04 EST


On Tue, Jul 23, 2002 at 08:45:07PM +0200, Gregory Giguashvili wrote:
> >Do a F_SETFL lock/unlock on the file That should act as a
> >full NFS write barrier and flush all buffers. Best is if you synchronize
> >between the various writers with the full lock.
>
> Do you mean F_SETLK? If so, this didn't help (the source is attached).

F_SETLK sorry.

You need to do it on both reader and writer. On the writer it acts
like a fsync(), on the reader it should clear the cache.

I think the problem in your case is that you have the pages mmaped.
NFS uses invalidate_inode_pages() to throw away the cache, but that
doesn't work when the pages are mapped. It may work to munmap/mmap
around the locking.

In theory with rmap (=2.5) the kernel could do that unmap/remap for you,
but it will be probably non trivial to implement.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 23 2002 - 22:00:44 EST