numa: fix memhog fails in test8
PATCH 1/1 numa: fix memhog fails in test8
memhog test fails on first iteration (when the memhog binary is not in the page cache) because the test script runs too fast and looks at the statistics even befor the memmhog binary has a chance to run.
In this patch, just redirectiong the output to a file and then checking the content in the script in a loop.
Suggested-by Cyril Hrubis <[email protected]>
Signed-off-by Li Wang <[email protected]>
--- testcases/kernel/numa/numa01.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
testcases/kernel/numa/numa01.sh +12 -1
@@ -315,9 +315,20 @@ test8() # Memory will be allocated using round robin on nodes. Exp_incr=$(echo "$MB / $total_nodes" |bc) - numactl --interleave=all memhog -r1000000 1MB 2>&1 >/dev/null & + numactl --interleave=all memhog -r1000000 1MB 2>&1 >ltp_numa_test8.log & pid=$! + local retries=20 + while [ $retries -gt 0 ]; do + + if grep -m1 -q '.' ltp_numa_test8.log; then + break + fi + + retries=$((retries-1)) + tst_sleep 50ms + done + for node in $nodes_list; do Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
Signature · 1 line
2.9.3
PATCH 1/1 numa: fix memhog fails in test8
Hi!
Quoted 6 lines
memhog test fails on first iteration (when the memhog binary is not in the page cache) because the test script runs too fast and looks at the statistics even befor the memmhog binary has a chance to run.
In this patch, just redirectiong the output to a file and then checking the content in the script in a loop.
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]