[pnfs] Stats on client data server communication.
Iyer, Rahul
Rahul.Iyer at netapp.com
Wed Jul 12 14:13:43 EDT 2006
Hmmm... Looks like I messed up on the copy paste somewhere... Here it is
again. For the nfs4files layoutdriver, this uses the hex notation of the
IP address for dserver identification.
Regards
Rahul
<-----start patch---->
Index: fs/nfs/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: fs/nfs/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 0x%x ---\n",
dev->ip_addr);
>
> rpc_print_iostats(f, dev->rpc_clnt);
> }
> }
>
> read_unlock(&hlist->dev_lock);
>
> return 0;
> }
>
517a550
> .show_stats = filelayout_show_stats,
Index: include/linux/nfs4_pnfs.h
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/include/linux/nfs4_pnfs.h,v
retrieving revision 1.9
diff -r1.9 nfs4_pnfs.h
76a77
> int (*show_stats) (struct seq_file *, struct pnfs_mount_type *);
<---- end patch ---->
-----Original Message-----
From: Dean Hildebrand [mailto:dhildebz at eecs.umich.edu]
Sent: Wednesday, July 12, 2006 8:03 AM
To: Iyer, Rahul
Cc: pnfs at linux-nfs.org
Subject: Re: [pnfs] Stats on client data server communication.
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