Subject: Re: nfsd page loaning
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 05/03/2003 10:58:20
hi,

this looks basically good.  the fix to ubc_fault() is fine.
we ought to think about sharing the code for managing the mappings
of loan-to-kernel pages between the socket code and the pipe code
(and anything else we might add in the future).  it's probaby fine
to have one global pool of loan-mapping space and let the various consumers
compete for it.


some notes on your XXXs:

+               lva = so_kvaalloc(npages << PAGE_SHIFT, slp->ns_so);
+               if (lva == 0) {
+                       /* XXX is it worth to fall back to VOP_READ? */
+                       error = ENOMEM;
+                       goto fail;

yes, we should avoid transient errors here.


+               /* loan and unbusy pages */
+               simple_lock(&vp->v_interlock);
+               /* XXX should check PG_RELEASED here? */
+               uvm_loanuobjpages(pgpp, npages);
+               simple_unlock(&vp->v_interlock);

since you're asserting in uvm_loanuobjpages() that the pages are not released,
you'll need to check for that here, yea.  the simplest thing to do if any of
the pages are released is to just uvm_page_unbusy() them all and retry
the VOP_GETPAGES().


otherwise this is great!

-Chuck


On Wed, Apr 23, 2003 at 12:07:52AM +0900, YAMAMOTO Takashi wrote:
> hi,
> 
> i made a patch to make nfsd use page-loaning for READ requests.
> can anyone please review it?
> (it includes a fix to make UBC pay attention for loaned pages.)
> 
> thanks.
> 
> YAMAMOTO Takashi