Whamcloud - gitweb
LU-16762 statahead: wait until statahead thread quit 02/52302/3
authorQian Yingjin <qian@ddn.com>
Thu, 7 Sep 2023 08:33:02 +0000 (04:33 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 01:55:38 +0000 (01:55 +0000)
It must wait until statahead thread quit. After that, we can get
accurate hit/miss stats for stat() workload such as "ls -l".

Test-Parameters: trivial
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I902b299e039de6c584b386856fb3f7a8989eb73b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52302
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index a09392e..d99d0b6 100755 (executable)
@@ -14331,7 +14331,8 @@ test_batch_statahead() {
        cancel_lru_locks osc
        time ls -l $DIR/$tdir | wc -l
        unbatch_rpcs=$(calc_stats mdc.*.stats ldlm_ibits_enqueue)
-       sleep 2
+       wait_update_facet client "pgrep ll_sa" "" 35 ||
+               error "ll_sa thread is still running"
        hit_total=$($LCTL get_param -n llite.*.statahead_stats |
                    awk '/hit.total:/ { print $NF }')
        # hit ratio should be larger than 75% (7500).
@@ -14348,7 +14349,8 @@ test_batch_statahead() {
        time ls -l $DIR/$tdir | wc -l
        batch_rpcs=$(calc_stats mdc.*.stats mds_batch)
        # wait for statahead thread to quit and update statahead stats
-       sleep 2
+       wait_update_facet client "pgrep ll_sa" "" 35 ||
+               error "ll_sa thread is still running"
        hit_total=$($LCTL get_param -n llite.*.statahead_stats |
                    awk '/hit.total:/ { print $NF }')
        # hit ratio should be larger than 75% (7500).