From 1542fead959733fbf09173622892724981e99ad1 Mon Sep 17 00:00:00 2001 From: "eugen.betke" Date: Tue, 30 Oct 2018 19:47:12 +0100 Subject: [PATCH] Drop caches waits until all Lustre caches are cleared --- benchmark/drop_caches.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/benchmark/drop_caches.sh b/benchmark/drop_caches.sh index 9cb9e1dc9..10da129e6 100755 --- a/benchmark/drop_caches.sh +++ b/benchmark/drop_caches.sh @@ -1,3 +1,19 @@ #!/bin/bash -echo 3 > /proc/sys/vm/drop_caches +oscs=( $( find /proc/fs/lustre/osc -mindepth 1 -maxdepth 1 -type d ) ) + +while [ ! 0 -eq ${#oscs[@]} ]; do + sync + echo 3 > /proc/sys/vm/drop_caches + + for i in ${!oscs[@]}; do + fillstat=$( grep -h used_mb ${oscs[$i]}/osc_cached_mb | cut -d" " -f 2 ) + if [ 0 == $fillstat ]; then + unset oscs[$i] + else + echo "skip ${oscs[$i]} $fillstat" + fi + done + sleep 1 +done +