You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libhugetlbfs/SOURCES/0018-mmap-tests-Run-tests-w...

55 lines
2.2 KiB

From d228c0e688e7a0771d30457d21b38d745cea63bf Mon Sep 17 00:00:00 2001
Message-Id: <d228c0e688e7a0771d30457d21b38d745cea63bf.1566225007.git.aquini@redhat.com>
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
From: Sandipan Das <sandipan@linux.ibm.com>
Date: Fri, 16 Aug 2019 11:45:08 +0530
Subject: [RHEL7 PATCH 18/31] mmap: tests: Run tests with correct huge page
count
This ensures that the mmap-gettest and mmap-cow tests are run
with the correct count of free huge pages. Previously, it was
always using the free page count for the default huge page size
for all huge page sizes. Since these counts can differ, trying
to get more pages via mmap() than what is available in the pool
can make these tests fail.
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Eric B Munson <eric@munsonfam.org>
Signed-off-by: Rafael Aquini <aquini@redhat.com>
---
tests/run_tests.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tests/run_tests.py b/tests/run_tests.py
index f19024f..b132da2 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -697,14 +697,19 @@ def stress_tests():
# Don't update NRPAGES every time like above because we want to catch the
# failures that happen when the kernel doesn't release all of the huge pages
# after a stress test terminates
- (rc, nr_pages) = free_hpages()
+ nr_pages = {p: free_hpages(p)[1] for p in pagesizes}
- do_test(("mmap-gettest", repr(iterations), repr(nr_pages)))
+ for p in pagesizes:
+ cmd = ("mmap-gettest", repr(iterations), repr(nr_pages[p]))
+ do_test_with_pagesize(p, cmd)
- # mmap-cow needs a hugepages for each thread plus one extra
- do_test(("mmap-cow", repr(nr_pages-1), repr(nr_pages)))
+ for p in pagesizes:
+ # mmap-cow needs a hugepage for each thread plus one extra
+ cmd = ("mmap-cow", repr(nr_pages[p]-1), repr(nr_pages[p]))
+ do_test_with_pagesize(p, cmd)
(rc, tot_pages) = total_hpages()
+ nr_pages = nr_pages[system_default_hpage_size]
limit = system_default_hpage_size * tot_pages
threads = 10 # Number of threads for shm-fork
--
1.8.3.1