Subject: Re: genfs_putpages with PGO_SYNCIO
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: tech-kern
Date: 01/20/2003 10:34:59
YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> writes:

> > 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
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?

btw,

>  			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?

> +			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.

> @@ -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.

enami.