[pnfs] [PATCH 19/20] 2.6-latest pnfs client no rpc nfs page cache cleanup

William A. (Andy) Adamson andros at citi.umich.edu
Fri Nov 30 09:50:20 EST 2007


On 11/29/07, Benny Halevy <bhalevy at panasas.com> wrote:
>
> On Nov. 29, 2007, 18:14 +0200, Benny Halevy <bhalevy at panasas.com> wrote:
> >
> > Also, how would pnfs4_read_done be called if the layout driver didn't
> > perform an rpc to do the I/O?


see fs/nfs/pnfs.c:pnfs_read_done() the non-rpc cleanup function. in order to
explain, here are the two pNFS read paths with RPC and without RPC (both use
the NFS page cache):

pNFS I/O with RPC:
pnfs_try_to_read()->pnfs_readpages->nfss->pnfs_curr_ld->ld_io_ops->read_pagelist()
       the RPC I/O read_pagelist function  e.g. filelayout_read_pagelist(),
sets the rpc_call_ops.

struct rpc_call_ops filelayout_read_call_ops = {
        .rpc_call_validate_args = nfs_read_validate,
        .rpc_call_done = filelayout_read_call_done,
        .rpc_release = nfs_readdata_release,
};
filelayout_read_call_done() calls wdata->call_ops->rpc_call_done(task,
data);
which is either nfs_readpage_result_full() or nfs_readpage_result_partial()
both of these functions call nfs_readpage_result() which in turn calls
NFS_PROTO(data->inode)->read_done() which is pnfs4_read_done().

pNFS I/O with NO RPC:
pnfs_try_to_read()->pnfs_readpages->nfss->pnfs_curr_ld->ld_io_ops->read_pagelist()
 the RPC I/O read_pagelist function  e.g. blocklayout_read_pagelist() or
objectlayout_read_pagelist()
 sets the PNFS_NO_RPC flag.
 perform  I/O.
upon I/O completion, call pnfs_client_operations->nfs_readlist_complete()
which is fs/nfs/pnfs.c:pnfs_read_done()

0019-2.6-latest-pnfs-client-no-rpc-nfs-page-cache-cleanup.patch adds the
PNFS_NO_RPC and changes pnfs_read_done
to call
+       data->call_ops->rpc_call_done(&data->task, data);
+       data->call_ops->rpc_release(data);

why? because the nfs page-cache cleanup portions for NON-RPC pNFS I/O is
exactly the same as for RPC pNFS I/O, and i thought that
instead of copying the non-rpc portions of the page-cache cleanup code into
a function as was done in
2.6.18.3fs/nfs/read.c:pnfs_readpage_result_norpc(), i would set a
PNFS_NO_RPC flag,
which when set would indicate "do all the non-rpc related cleanup", and call
the RPC path functions.

so pnfs_read_done calls data->call_ops->rpc_call_done() which is either
nfs_readpage_result_full() or nfs_readpage_result_partial()
both of these functions call nfs_readpage_result() which in turn calls
NFS_PROTO(data->inode)->read_done() which is pnfs4_read_done, which does the
right thing for the NO_RPC path when the PNFS_NO_RPC flag is set.

pnfs_read_done also calls data->call_ops->rpc_release() which is
nfs_readdata_release(), which calls nfs_readpage_retry() which does nothing
if the PNFS_NO_RPC flag is set.....

although a bit confusing, in my view the code is cleaner, and easier to
maintain because we don't copy code into our own function....

-->Andy





is this the call site?
>
> >
> >
> >> @@ -927,12 +929,17 @@ pnfs_read_done(struct nfs_read_data* data,
> ssize_t status, int eof)
> <snip>
> >> +
> >> +    /* call the NFS cleanup routines. */
> >> +    data->call_ops->rpc_call_done(&data->task, data);
> >> +    data->call_ops->rpc_release(data);
> >>  }
> >>
>
>
> Benny
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20071130/3a38095c/attachment.htm 


More information about the pNFS mailing list