Whamcloud - gitweb
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>