[pnfs] Stats on client data server communication.

Dean Hildebrand dhildebz at eecs.umich.edu
Wed Jul 12 11:03:21 EDT 2006


Hi Rahul,

Seems like a great idea.  Is this the entire patch?  I think there might 
be some chunks missing....
Dean

Iyer, Rahul wrote:
> Hi,
> Currently,  there seems to be no standard way on obtaining statistics 
> (RTT, average queue time etc.) on the communication between the client 
> and the data servers. /proc/<pid>/mountstats gives us information on 
> the client to MDS communication only. With pNFS, the number of 
> read/write rpcs turns out to be 0 as no such calls were made.
>  
> I've written a small patch in order to get these statistics. The patch 
> does 3 main things:
> 1. It adds a new operation "show_stats" to the 
> layoutdriver_io_operations struct. This was needed as we need 
> statistics per data server/device and these devices are layout specific.
>  
> 2. It adds a call to the layout driver's show_stats() function (if one 
> exists) to the nfs_show_stats() function. This causes the per data 
> server statistics also to be reported in /proc/<pid>/mountstats.
>  
> 3. An implementation for show_stats for the nfsv4 file based back ends.
>  
> Do you think this is a good way to expose these statistics?
> The patch is attached herewith.
> Thanks
> Rahul
>  
>  
> Index: inode.c
> ===================================================================
> RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/inode.c,v
> retrieving revision 1.14
> diff -r1.14 inode.c
> 802a803,808
> > #ifdef CONFIG_NFS_V4
> >       if (nfss->pnfs_curr_ld && nfss->pnfs_mountid && 
> nfss->pnfs_curr_ld->ld_io_ops && 
> nfss->pnfs_curr_ld->ld_io_ops->show_stats) {
> >               nfss->pnfs_curr_ld->ld_io_ops->show_stats(m, 
> nfss->pnfs_mountid);
> >       }
> > #endif
> >
> Index: nfs4filelayout.c
> ===================================================================
> RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/nfs4filelayout.c,v
> retrieving revision 1.22
> diff -r1.22 nfs4filelayout.c
> 51a52,53
> > #include <linux/seq_file.h>
> > #include <linux/sunrpc/metrics.h>
> 465a468,497
> > int
> > filelayout_show_stats(struct seq_file *f, struct pnfs_mount_type *mt)
> > {
> >       struct filelayout_mount_type *f_mt;
> >       struct nfs4_pnfs_dev_hlist *hlist;
> >       struct hlist_node *hptr;
> >
> >       int i;
> >
> >       f_mt = (struct filelayout_mount_type *)mt->mountid;
> >       hlist = f_mt->hlist;
> >
> >       read_lock(&hlist->dev_lock);
> >
> >       for (i = 0; i < NFS4_PNFS_DEV_HASH; ++i) {
> >               hlist_for_each(hptr, &hlist->dev_list[i]) {
> >                       struct nfs4_pnfs_dev_item *dev;
> >
> >                       dev = hlist_entry(hptr, struct 
> nfs4_pnfs_dev_item, hash_node);
> >                       seq_printf(f, "---- Data Server ---\n");
> >
> >                       rpc_print_iostats(f, dev->rpc_clnt);
> >               }
> >       }
> >
> >       read_unlock(&hlist->dev_lock);
> >
> >       return 0;
> > }
> >
> 517a550
> >       .show_stats              = filelayout_show_stats,
> ------------------------------------------------------------------------
>
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs

-- 
Dean Hildebrand
Ph.D. Candidate
University of Michigan



More information about the pNFS mailing list