counters: update to new sysctl

To allow the interface to be more flexible, I changed the upstream
sysctl, /proc/sys/vm/hugetlb_dynamic_pool to
/proc/sys/vm/nr_overcommit_hugepages. This change needs to be reflected
in the counters test and run_tests.sh

Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>

diff --git a/tests/counters.c b/tests/counters.c
index 0aff877..99632ee 100644
--- a/tests/counters.c
+++ b/tests/counters.c
@@ -46,7 +46,7 @@ extern int errno;
 #define BUF_SZ 1024
 
 /* Global test configuration */
-#define DYNAMIC_SYSCTL "/proc/sys/vm/hugetlb_dynamic_pool"
+#define DYNAMIC_SYSCTL "/proc/sys/vm/nr_overcommit_hugepages"
 static long saved_nr_hugepages;
 static long hpage_size;
 
@@ -92,7 +92,7 @@ void verify_dynamic_pool_support(void)
 
        if (read(fd, &value, 1) != 1)
                FAIL("Unable to read %s", DYNAMIC_SYSCTL);
-       if (value != '1')
+       if (value == '0')
                CONFIG("Dynamic hugetlb pool support present, but disabled");
        close(fd);
 }
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 8f1e7ac..61cc900 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -125,12 +125,12 @@ restore_shm_sysctl() {
 }
 
 setup_dynamic_pool_sysctl() {
-    DYNAMIC_POOL=`cat /proc/sys/vm/hugetlb_dynamic_pool`
-    echo 1 > /proc/sys/vm/hugetlb_dynamic_pool
+    DYNAMIC_POOL=`cat /proc/sys/vm/nr_overcommit_hugepages`
+    echo 10 > /proc/sys/vm/hugetlb_dynamic_pool
 }
 
 restore_dynamic_pool_sysctl() {
-    echo "$DYNAMIC_POOL" > /proc/sys/vm/hugetlb_dynamic_pool
+    echo "$DYNAMIC_POOL" > /proc/sys/vm/nr_overcommit_hugepages
 }
 
 functional_tests () {

-- 
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to