Re: mmap over nfs leads to excessive system load

From: Trond Myklebust
Date: Wed Nov 16 2005 - 19:47:23 EST


On Wed, 2005-11-16 at 16:38 -0800, Andrew Morton wrote:

> I don't know if it'll be a problem. One factor is that when the VFS is
> doing an fsync() or whatever, it will fail to notice these left-over pages
> are "dirty", so it won't launch writepage() against them.

That doesn't matter. They are being tracked by the NFS client. We don't
want anyone to call writepage() against them again because that will
cause them to be written out twice.

> But if they are marked PageWriteback(), sync will notice them on the second
> pass and will wait upon them, which apparently could mean a stall until
> pdflush kicks off the I/O?
>
> If they're not marked PageDirty() or PageWriteback(), the VFS will miss
> them altogether during the sync. But perhaps NFS's own page tracking will
> flush them and wait upon the result?

Yes. There is no chance of data loss (unless someone physically pulls
the plug on the client - there's no protecting against that).

Note that writepages() will normally end up calling nfs_flush_inode().

It will only fail to do so if

- generic_writepages() returns an error
or
- there is write congestion, and wbc->nonblocking is set.

Cheers,
Trond

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