Subject: Re: genfs_putpages with PGO_SYNCIO
To: None <enami@sm.sony.co.jp>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/20/2003 18:44:05
hi.

> > > sure.  I agree that struct buf here is overkill.
> > > maybe we should have stripped version of struct buf.
> > 
> > i made a new patch, with a new struct (stripped version of buf).
> > how about this?
> 
> Hm, what is the benefit of using stripped version of struct buf?  At

code sharing with biowait/biodone.

> least you're forced to use slight hack to prevent `done' routine being
> called by borrowing struct buf related routine for this.  Is so much
> code duplicated without this?

not so much, i think.

do you mean "it's better to introduce a completely different structure
than abusing a part of struct buf" ?


> >  			if (pg->offset < startoff || pg->offset >= endoff ||
> >  			    pg->flags & (PG_RELEASED|PG_PAGEOUT)) {
> > +				if (pg->flags & (PG_RELEASED|PG_PAGEOUT))
> > +					metbusy = TRUE;
> 
> Even if page is not interested?  Or can we ignore the case?

it's a bug.  thanks.


> > +			if (!async && bip == NULL) {
> > +				bip = pool_get(&bioprogpl, PR_WAITOK);
> > +				bip->bi_flags = B_BUSY|B_WRITE; /* XXX */
> 
> This is called with uobj->vmobjlock held, but it's not necessary i guess.

sure.


> > @@ -1466,9 +1530,10 @@ genfs_gop_write(struct vnode *vp, struct
> >  		UVMHIST_LOG(ubchist, "returning 0 (async)", 0,0,0,0);
> >  		return (0);
> >  	}
> > -	UVMHIST_LOG(ubchist, "waiting for mbp %p", mbp,0,0,0);
> > -	error = biowait(mbp);
> > -	uvm_aio_aiodone(mbp);
> > +	/*
> > +	 * We don't have to wait for I/O completions even for PGO_SYNCIO
> > +	 * because genfs_putpages will wait for us.
> > +	 */
> 
> if (async) {...} just above this change isn't necessary anymore.

sure. i preserved it just for UVMHIST_LOG.

YAMAMOTO Takashi