Skip to content

Commit d88825f

Browse files
davidhildenbrandakpm00
authored andcommitted
selftests/vm: madv_populate: fix missing MADV_POPULATE_(READ|WRITE) definitions
The tests fail to compile in some environments (e.g., Debian 11.5 on x86). Let's simply conditionally define MADV_POPULATE_(READ|WRITE) if not already defined, similar to how the khugepaged.c test handles it. Link: https://lkml.kernel.org/r/[email protected] Fixes: 39b2e5c ("selftests/vm: make MADV_POPULATE_(READ|WRITE) use in-tree headers") Signed-off-by: David Hildenbrand <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Yang Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a0ac9b3 commit d88825f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/testing/selftests/vm/madv_populate.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
#include "../kselftest.h"
2121
#include "vm_util.h"
2222

23+
#ifndef MADV_POPULATE_READ
24+
#define MADV_POPULATE_READ 22
25+
#endif /* MADV_POPULATE_READ */
26+
#ifndef MADV_POPULATE_WRITE
27+
#define MADV_POPULATE_WRITE 23
28+
#endif /* MADV_POPULATE_WRITE */
29+
2330
/*
2431
* For now, we're using 2 MiB of private anonymous memory for all tests.
2532
*/

0 commit comments

Comments
 (0)