For unification number of nodes is set based on environment.

In accordance to Documentation/sysctl/vm.txt to reliably drop caches
we should invoke 'sync' before 'echo N > /proc/sys/vm/drop_caches'.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmansk...@oracle.com>
---
 .../cpuset_memory_spread_testset.sh                |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git 
a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
 
b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
index a357e22..ffce419 100755
--- 
a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
+++ 
b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
@@ -32,8 +32,8 @@ export TST_COUNT=1
 
 exit_status=0
 # must >= 3 for: 1-$((nr_mems-2))
-nr_cpus=4
-nr_mems=3
+nr_cpus=$NR_CPUS
+nr_mems=$N_NODES
 
 # In general, the cache hog will use more than 10000 kb slab space on the nodes
 # on which it is running. The other nodes' slab space has littler change.(less
@@ -223,6 +223,7 @@ general_memory_spread_test()
        fi
 
        # we'd better drop the caches before we test page cache.
+       sync
        /bin/echo 3 > /proc/sys/vm/drop_caches 2> $CPUSET_TMP/stderr
        if [ $? -ne 0 ]; then
                cpuset_log_error $CPUSET_TMP/stderr
@@ -230,9 +231,6 @@ general_memory_spread_test()
                return 1
        fi
 
-       # wait for droping the cache
-       sleep 10
-
        get_memsinfo
        /bin/kill -s SIGUSR1 $test_pid
        read exit_num < $FIFO
@@ -344,12 +342,6 @@ if [ $? -ne 0 ]; then
        exit 1
 fi
 
-# drop page caches
-/bin/echo 1 > /proc/sys/vm/drop_caches
-
-# wait for droping caches
-sleep 10
-
 mkfifo $FIFO
 if [ $? -ne 0 ]; then
        rm -f DATAFILE
-- 
1.7.1


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to