On 24.06.25 03:48, Baolin Wang wrote:
On 2025/6/23 21:54, David Hildenbrand wrote:
diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/
selftests/mm/khugepaged.c
index 4341ce6b3b38..85bfff53dba6 100644
--- a/tools/testing/selftests/mm/khugepaged.c
+++ b/tools/testing/selftests/mm/khugepaged.c
@@ -501,11 +501,7 @@ static void __madvise_collapse(const char *msg,
char *p, int nr_hpages,
printf("%s...", msg);
- /*
- * Prevent khugepaged interference and tests that MADV_COLLAPSE
- * ignores /sys/kernel/mm/transparent_hugepage/enabled
- */
- settings.thp_enabled = THP_NEVER;
+ settings.thp_enabled = THP_ALWAYS;
Would MADVISE mode also work here? If we don't set MADV_HUGEPAGE, then
khugepaged should be excluded, correct?
I tried this, but some test cases failed. As I replied to Barry, it's
because some tests previously set MADV_NOHUGEPAGE, and now there is no
way to clear the MADV_NOHUGEPAGE flag except by setting MADV_HUGEPAGE.
Okay, can you add that detail to the patch description.
I suspect we really want a way to undo what MADV_NOHUGEPAGE/MADV_NOHUGEPAGE did (if only naming wouldn't be complicated: MADV_DEFAULT_HUGEPAGE, hmmmm).