Skip to contentSkip to conversation

khugepaged: selftests: fix timeout condition in wait_for_scan()

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 khugepaged: selftests: fix timeout condition in wait_for_scan()

The loop exits with "timeout" set to -1 and not to 0 so the test needs to be fixed.

Fixes e7b592f6caca ("khugepaged: add self test")
---
 tools/testing/selftests/vm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/khugepaged.c +1 -1
index 51b89cedd09d1..8b75821302a79 100644
@@ -502,7 +502,7 @@ static bool wait_for_scan(const char *msg, char *p)
 
 	madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE);
 
-	return !timeout;
+	return timeout = -1;
 }
 
 static void alloc_at_fault(void)
Signature · 1 line
2.26.2
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Dan Carpenter

The loop exits with "timeout" set to -1 and not to 0 so the test needs to be fixed.

Fixes e7b592f6caca ("khugepaged: add self test")
---
 tools/testing/selftests/vm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/khugepaged.c +0 -0
index 51b89cedd09d1..8b75821302a79 100644

tools/testing/selftests/vm/khugepaged.c static bool wait_for_scan(const char *msg, char *p) · line 508

Quoted 8 lines
tools/testing/selftests/vm/khugepaged.c +1 -1
@@ -502,7 +502,7 @@ static bool wait_for_scan(const char *msg, char *p)
 
 	madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE);
 
-	return !timeout;
+	return timeout = -1;
 }
 
 static void alloc_at_fault(void)

Thanks.

Signature · 1 line
 Kirill A. Shutemov