Subject: Re: genfs_putpages with PGO_SYNCIO
To: None <chuq@chuq.com>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/13/2003 11:39:21
hi,

there's no particular reason.
i just thought that redundant syncing is a bad thing for performance.

YAMAMOTO Takashi

> hi,
> 
> I think there was some interaction with NFS related to this.
> I don't remember for sure, though.
> 
> is there some particular reason you want to make this change,
> or is it just on general principles?
> 
> -Chuck
> 
> 
> On Sat, Jan 11, 2003 at 01:26:22AM +0900, YAMAMOTO Takashi wrote:
> > hi,
> > 
> > when genfs_putpages is called with PGO_SYNCIO,
> > it passes the flag to GOP_WRITE as well.  and GOP_WRITE do i/o synchronously.
> > but it seems redundant to me because after that, genfs_putpages will wait
> > for i/o completetion by itsself.
> > is attached patch ok?
> > thanks.
> > 
> > YAMAMOTO Takashi
> 
> > Index: genfs_vnops.c
> > ===================================================================
> > RCS file: /cvs/NetBSD/src/sys/miscfs/genfs/genfs_vnops.c,v
> > retrieving revision 1.68
> > diff -u -p -r1.68 genfs_vnops.c
> > --- genfs_vnops.c	2002/11/15 14:01:57	1.68
> > +++ genfs_vnops.c	2003/01/10 16:14:58
> > @@ -1281,7 +1291,12 @@ genfs_putpages(void *v)
> >  				    listq);
> >  			}
> >  			simple_unlock(slock);
> > -			error = GOP_WRITE(vp, pgs, npages, flags);
> > +			KASSERT(!wasclean);
> > +			/*
> > +			 * no need to wait for PGO_SYNCIO here
> > +			 * because we'll do so later.
> > +			 */
> > +			error = GOP_WRITE(vp, pgs, npages, flags & ~PGO_SYNCIO);
> >  			simple_lock(slock);
> >  			if (by_list) {
> >  				pg = TAILQ_NEXT(&curmp, listq);