Subject: Re: nfs vs pagedaemon
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 04/15/2003 07:00:37
On Thu, Apr 10, 2003 at 10:15:03AM +0900, YAMAMOTO Takashi wrote:
> hi
>
> > yea, this makes sense. the more general description of the problem
> > is that nfs_strategy() should only use the commit mechanism when it's
> > being called from VOP_PUTPAGES() on an NFS vnode, but there are other
> > ways that nfs_strategy() can be called. NFS swap files is one way we
> > can go wrong, but there are others, such as using an NFS file for
> > a vnd backing file. one way to fix this more completely would be to
> > have the NFS VOP_PUTPAGES() path add an extra flag to its buffers
> > that nfs_strategy() can look at to decide if it should use stable writes.
> > I had written this up a while back but didn't commit it for some reason.
> > the diff is attached if you want to pursue it.
>
> the patch seems to disable commit mechanism even in the case of
> synchronous B_PAGEIO. it's a overkill, isn't it?
I hadn't bothered to try to optimize synchronous i/o requests.
if you want to do so, that would be fine.
the change you checked in isn't quite correct, though.
if someone does a physio write (via vnd) to an NFS file from a mapping of
the same file at a different offset, you'd set PG_NEEDCOMMMIT on the
pages from the mapping instead of the pages for the range being modified
(which might not even exist on the client).
-Chuck