From e07f1041867d9888a1e5cca0a0e5ca11872ac8f8 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 6 Mar 2020 16:58:46 -0700 Subject: [PATCH] LU-12207 tests: allow some margin for sanity/76 With newer slab allocators it is possible that the kernel may keep some inodes in the per-cpu cache and not release all of them. This was resulting sanity test_76 failures with a few (often 12) inodes not being freed of the inodes that are created by the test, like: inode slab grew from 3224 to 3236 inode slab grew from 70368 to 70380 inode slab grew from 68878 to 68890 Allow some small number of inodes (8 per core) cached on the client without considering it a test failure failure. Clean up test_76 code style to current standards. Test-Parameters: trivial testlist=sanity env=ONLY=76,ONLY_REPEAT=100 Signed-off-by: Andreas Dilger Change-Id: Ia3f60de2fb471bb32da27d36665a3a0fd43ebbe5 Reviewed-on: https://review.whamcloud.com/37827 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Ben Evans Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1f25579..a2dfedd 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -8237,28 +8237,27 @@ num_inodes() { test_76() { # Now for bug 20433, added originally in bug 1443 [ $PARALLEL == "yes" ] && skip "skip parallel run" - local CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null) - cancel_lru_locks osc - BEFORE_INODES=$(num_inodes) - echo "before inodes: $BEFORE_INODES" - local COUNT=1000 - [ "$SLOW" = "no" ] && COUNT=100 - for i in $(seq $COUNT); do + local cpus=$(getconf _NPROCESSORS_ONLN 2>/dev/null) + local before=$(num_inodes) + local count=$((512 * cpus)) + [ "$SLOW" = "no" ] && count=$((64 * cpus)) + + echo "before inodes: $before" + for i in $(seq $count); do touch $DIR/$tfile rm -f $DIR/$tfile done cancel_lru_locks osc - AFTER_INODES=$(num_inodes) - echo "after inodes: $AFTER_INODES" - local wait=0 - while [[ $((AFTER_INODES-1*${CPUS:-1})) -gt $BEFORE_INODES ]]; do - sleep 2 - AFTER_INODES=$(num_inodes) - wait=$((wait+2)) - echo "wait $wait seconds inodes: $AFTER_INODES" - if [ $wait -gt 30 ]; then - error "inode slab grew from $BEFORE_INODES to $AFTER_INODES" + local after=$(num_inodes) + echo "after inodes: $after" + while (( after > before + 8 * ${cpus:-1} )); do + sleep 1 + after=$(num_inodes) + wait=$((wait + 1)) + (( wait % 5 == 0 )) && echo "wait $wait seconds inodes: $after" + if (( wait > 30 )); then + error "inode slab grew from $before to $after" fi done } -- 1.8.3.1