Skip to contentSkip to conversation

syscalls/set_mempolicy04: Fix mistake

PATCH New Cyril Hrubis 1 participant 1 message Mar 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/set_mempolicy04: Fix mistake

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.

---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +2 -2
index 8d8aa988d..32d7b7f41 100644
@@ -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>",
Signature · 1 line
2.19.2