[COMMITTED] syscalls/set_mempolicy04: Fix mistake
diff mbox series

Message ID 20190312150540.23077-1-chrubis@suse.cz
State Accepted
Delegated to: Petr Vorel
Headers show
Series
  • [COMMITTED] syscalls/set_mempolicy04: Fix mistake
Related show

Commit Message

Cyril Hrubis March 12, 2019, 3:05 p.m. UTC
I've accidentally left the number of numa nodes hardcoded in the
computation so this test was failing on anything but machines with
three nodes.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
index 8d8aa988d..32d7b7f41 100644
--- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
+++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
@@ -77,8 +77,8 @@  static void alloc_and_check(void)
 
 	for (i = 0; i < nodes->cnt; i++) {
 		float treshold = 1.00 * total_pages / 60; /* five percents */
-		float min_pages = 1.00 * total_pages / 3 - treshold;
-		float max_pages = 1.00 * total_pages / 3 + treshold;
+		float min_pages = 1.00 * total_pages / nodes->cnt - treshold;
+		float max_pages = 1.00 * total_pages / nodes->cnt + treshold;
 
 		if (nodes->counters[i] > min_pages && nodes->counters[i] < max_pages) {
 			tst_res(TPASS, "Node %u allocated %u <%.2f,%.2f>",