* [PATCH v2 0/1] Update nfsiostat to display readahead counts @ 2021-10-09 12:27 Dave Wysochanski 2021-10-09 12:27 ` [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 Dave Wysochanski 0 siblings, 1 reply; 3+ messages in thread From: Dave Wysochanski @ 2021-10-09 12:27 UTC (permalink / raw) To: chuck.lever, steved; +Cc: linux-nfs Changes from v1 * Move parsing of 'statsver' into parse routine * Simplify logic Dave Wysochanski (1): nfsiostat: Handle both readahead counts for statsver >= 1.2 tools/nfs-iostat/nfs-iostat.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 2021-10-09 12:27 [PATCH v2 0/1] Update nfsiostat to display readahead counts Dave Wysochanski @ 2021-10-09 12:27 ` Dave Wysochanski 2022-10-24 17:42 ` Steve Dickson 0 siblings, 1 reply; 3+ messages in thread From: Dave Wysochanski @ 2021-10-09 12:27 UTC (permalink / raw) To: chuck.lever, steved; +Cc: linux-nfs Later kernel versions convert NFS readpages to readahead so update the counts accordingly. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> --- tools/nfs-iostat/nfs-iostat.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py index 1df74ba822b5..85294fb9448c 100755 --- a/tools/nfs-iostat/nfs-iostat.py +++ b/tools/nfs-iostat/nfs-iostat.py @@ -43,7 +43,7 @@ NfsEventCounters = [ 'vfspermission', 'vfsupdatepage', 'vfsreadpage', - 'vfsreadpages', + 'vfsreadpages', # or vfsreadahead in statvers=1.2 or above 'vfswritepage', 'vfswritepages', 'vfsreaddir', @@ -86,14 +86,14 @@ class DeviceData: self.__nfs_data['export'] = words[1] self.__nfs_data['mountpoint'] = words[4] self.__nfs_data['fstype'] = words[7] - if words[7] == 'nfs': - self.__nfs_data['statvers'] = words[8] + if words[7] == 'nfs' or words[7] == 'nfs4': + self.__nfs_data['statvers'] = float(words[8].split('=',1)[1]) elif 'nfs' in words or 'nfs4' in words: self.__nfs_data['export'] = words[0] self.__nfs_data['mountpoint'] = words[3] self.__nfs_data['fstype'] = words[6] if words[6] == 'nfs': - self.__nfs_data['statvers'] = words[7] + self.__nfs_data['statvers'] = float(words[7].split('=',1)[1]) elif words[0] == 'age:': self.__nfs_data['age'] = int(words[1]) elif words[0] == 'opts:': @@ -294,8 +294,11 @@ class DeviceData: print() print('%d nfs_readpage() calls read %d pages' % \ (vfsreadpage, vfsreadpage)) - print('%d nfs_readpages() calls read %d pages' % \ - (vfsreadpages, pages_read - vfsreadpage)) + multipageread = "readpages" + if self.__nfs_data['statvers'] >= 1.2: + multipageread = "readahead" + print('%d nfs_%s() calls read %d pages' % \ + (vfsreadpages, multipageread, pages_read - vfsreadpage)) if vfsreadpages != 0: print('(%.1f pages per call)' % \ (float(pages_read - vfsreadpage) / vfsreadpages)) -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 2021-10-09 12:27 ` [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 Dave Wysochanski @ 2022-10-24 17:42 ` Steve Dickson 0 siblings, 0 replies; 3+ messages in thread From: Steve Dickson @ 2022-10-24 17:42 UTC (permalink / raw) To: Dave Wysochanski, chuck.lever; +Cc: linux-nfs On 10/9/21 8:27 AM, Dave Wysochanski wrote: > Subject: > [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 > From: > Dave Wysochanski <dwysocha@redhat.com> > Date: > 10/9/21, 8:27 AM > > To: > chuck.lever@oracle.com, steved@redhat.com > CC: > linux-nfs@vger.kernel.org > > > Later kernel versions convert NFS readpages to readahead so update > the counts accordingly. > > Signed-off-by: Dave Wysochanski<dwysocha@redhat.com> Committed... steved > --- > tools/nfs-iostat/nfs-iostat.py | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py > index 1df74ba822b5..85294fb9448c 100755 > --- a/tools/nfs-iostat/nfs-iostat.py > +++ b/tools/nfs-iostat/nfs-iostat.py > @@ -43,7 +43,7 @@ NfsEventCounters = [ > 'vfspermission', > 'vfsupdatepage', > 'vfsreadpage', > - 'vfsreadpages', > + 'vfsreadpages', # or vfsreadahead in statvers=1.2 or above > 'vfswritepage', > 'vfswritepages', > 'vfsreaddir', > @@ -86,14 +86,14 @@ class DeviceData: > self.__nfs_data['export'] = words[1] > self.__nfs_data['mountpoint'] = words[4] > self.__nfs_data['fstype'] = words[7] > - if words[7] == 'nfs': > - self.__nfs_data['statvers'] = words[8] > + if words[7] == 'nfs' or words[7] == 'nfs4': > + self.__nfs_data['statvers'] = float(words[8].split('=',1)[1]) > elif 'nfs' in words or 'nfs4' in words: > self.__nfs_data['export'] = words[0] > self.__nfs_data['mountpoint'] = words[3] > self.__nfs_data['fstype'] = words[6] > if words[6] == 'nfs': > - self.__nfs_data['statvers'] = words[7] > + self.__nfs_data['statvers'] = float(words[7].split('=',1)[1]) > elif words[0] == 'age:': > self.__nfs_data['age'] = int(words[1]) > elif words[0] == 'opts:': > @@ -294,8 +294,11 @@ class DeviceData: > print() > print('%d nfs_readpage() calls read %d pages' % \ > (vfsreadpage, vfsreadpage)) > - print('%d nfs_readpages() calls read %d pages' % \ > - (vfsreadpages, pages_read - vfsreadpage)) > + multipageread = "readpages" > + if self.__nfs_data['statvers'] >= 1.2: > + multipageread = "readahead" > + print('%d nfs_%s() calls read %d pages' % \ > + (vfsreadpages, multipageread, pages_read - vfsreadpage)) > if vfsreadpages != 0: > print('(%.1f pages per call)' % \ > (float(pages_read - vfsreadpage) / vfsreadpages)) > -- 1.8.3.1 > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-24 19:05 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-09 12:27 [PATCH v2 0/1] Update nfsiostat to display readahead counts Dave Wysochanski 2021-10-09 12:27 ` [PATCH v2 1/1] nfsiostat: Handle both readahead counts for statsver >= 1.2 Dave Wysochanski 2022-10-24 17:42 ` Steve Dickson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.