Whamcloud - gitweb
LU-13909 tests: get lustre_inode_cache count from sysfs 35/39735/2
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 26 Aug 2020 22:17:50 +0000 (16:17 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 12 Sep 2020 15:45:57 +0000 (15:45 +0000)
commitdc08f71bf98a2e126750b7d1e6d2c3dd63d1edc2
tree23723fd506fbb0cad772b417f3f46b15750567d6
parent947af94817f8eeb5e6108b0b3cde65419b13c8d3
LU-13909 tests: get lustre_inode_cache count from sysfs

If slab cache merging is enabled (which is the default for newer
kernels), then there may not be a dedicated 'lustre_inode_cache'
entry in /proc/slabinfo (it may be aliased with 'signal_cache' and
'ptlrpc_cache' and/or other slabs of the same size).  This may result
in num_inodes() returning nothing to the caller, causing sanity
test_76() to not actually check anything useful.

Instead of looking for the number of cached inodes in /proc/slabinfo,
get this count from /sys/kernel/slab/lustre_inode_cache/objects if
available.  While it may not hold the actual number of cached inodes
due to slab sharing, sanity test_76 only cares about the relative
increase in cached inodes before and after running the test.

Due to slab sharing, the margin for error in counting cached objects
in the "lustre_inode_cache" slab can be fairly large (it may also be
shared with 'ptlrpc_cache' and increase significantly when sending
many RPCs).  The main goal of test_76 is to ensure there are not
persistently more objects cached in this slab compared to before
the create/unlink loop was run.

Test-Parameters: trivial testlist=sanity env=ONLY=76,ONLY_REPEAT=50
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I11066680b7add1ec1e0b4d15ff0ef7a3a666b484
Reviewed-on: https://review.whamcloud.com/39735
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh