From 76eddbeeace4684507650652ce4fa343c2d14e1a Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Thu, 7 Sep 2023 04:33:02 -0400 Subject: [PATCH] LU-16762 statahead: wait until statahead thread quit 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 Change-Id: I902b299e039de6c584b386856fb3f7a8989eb73b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52302 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index a09392e..d99d0b6 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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). -- 1.8.3.1