[LTP] [PATCH v1] Add more madvise testcases in madvise01

Andrea Cervesato andrea.cervesato@suse.com
Wed Aug 24 10:06:38 CEST 2022


Added MADV_COLD and MADV_PAGEOUT madvise modes and created two new
testcases in madvise01 for them. Supported by kernel >= 5.4.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/lapi/mmap.h                           | 8 ++++++++
 testcases/kernel/syscalls/madvise/madvise01.c | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
index 12845b76e..49108338b 100644
--- a/include/lapi/mmap.h
+++ b/include/lapi/mmap.h
@@ -66,6 +66,14 @@
 # define MADV_KEEPONFORK 19
 #endif
 
+#ifndef MADV_COLD
+# define MADV_COLD	20
+#endif
+
+#ifndef MADV_PAGEOUT
+# define MADV_PAGEOUT	21
+#endif
+
 #ifndef MAP_FIXED_NOREPLACE
 
 #ifdef __alpha__
diff --git a/testcases/kernel/syscalls/madvise/madvise01.c b/testcases/kernel/syscalls/madvise/madvise01.c
index de5daf34a..ec64a1db3 100644
--- a/testcases/kernel/syscalls/madvise/madvise01.c
+++ b/testcases/kernel/syscalls/madvise/madvise01.c
@@ -55,6 +55,8 @@ static struct tcase {
 	{MADV_FREE,        "MADV_FREE",        &amem},  /* since Linux 4.5 */
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &amem},  /* since Linux 4.14 */
 	{MADV_KEEPONFORK,  "MADV_KEEPONFORK",  &amem},  /* since Linux 4.14 */
+	{MADV_COLD,        "MADV_COLD",        &amem},  /* since Linux 5.4 */
+	{MADV_PAGEOUT,     "MADV_PAGEOUT",     &amem},  /* since Linux 5.4 */
 
 };
 
-- 
2.35.3



More information about the ltp mailing list