Skip to contentSkip to conversation

madvise: add MADV_WIPEONFORK/MADV_KEEPONFORK in madvise() test

PATCH New Li Wang 2 participants 3 messages May 14, 2018 – Jun 19, 2018

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/2 madvise: add MADV_WIPEONFORK/MADV_KEEPONFORK in madvise() test

The kernel commit (d2cd9ed mm,fork: introduce MADV_WIPEONFORK) introduces two new advices for madvise() in kernel-v4.14. Here making LTP cover that test accordingly.

---
 include/lapi/mmap.h                           | 5 +++++
 testcases/kernel/syscalls/madvise/madvise01.c | 3 +++
 2 files changed, 8 insertions(+)
include/lapi/mmap.h +5 -0
index 7a55800..18547c0 100644
@@ -71,6 +71,11 @@
 # define MADV_FREE	8
 #endif
 
+#ifndef MADV_WIPEONFORK
+# define MADV_WIPEONFORK 18
+# define MADV_KEEPONFORK 19
+#endif
+
 #ifdef HAVE_SYS_SHM_H
 # include <sys/shm.h>
 # define MMAP_GRANULARITY SHMLBA
testcases/kernel/syscalls/madvise/madvise01.c +3 -0
index 4b18a21..8d1d787 100644
@@ -62,6 +62,9 @@ static struct tcase {
 	{MADV_DONTDUMP,    "MADV_DONTDUMP",    &sfile}, /* since Linux 3.4 */
 	{MADV_DODUMP,      "MADV_DODUMP",      &sfile}, /* since Linux 3.4 */
 	{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 */
+
 };
 
 static void setup(void)
Signature · 1 line
2.9.5
author
#1 lore raw

PATCH 1/2 madvise: add MADV_WIPEONFORK/MADV_KEEPONFORK in madvise() test

ping

Quoted 53 lines · Li Wang

The kernel commit (d2cd9ed mm,fork: introduce MADV_WIPEONFORK) introduces two new advices for madvise() in kernel-v4.14. Here making LTP cover that test accordingly.

---
 include/lapi/mmap.h                           | 5 +++++
 testcases/kernel/syscalls/madvise/madvise01.c | 3 +++
 2 files changed, 8 insertions(+)
include/lapi/mmap.h +5 -0
index 7a55800..18547c0 100644
@@ -71,6 +71,11 @@
 # define MADV_FREE     8
 #endif
 
+#ifndef MADV_WIPEONFORK
+# define MADV_WIPEONFORK 18
+# define MADV_KEEPONFORK 19
+#endif
+
 #ifdef HAVE_SYS_SHM_H
 # include <sys/shm.h>
 # define MMAP_GRANULARITY SHMLBA
testcases/kernel/syscalls/madvise/madvise01.c +1 -0
index 4b18a21..8d1d787 100644
@@ -62,6 +62,9 @@ static struct tcase {
        {MADV_DONTDUMP,    "MADV_DONTDUMP",    &sfile}, /* since Linux 3.4
 */
        {MADV_DODUMP,      "MADV_DODUMP",      &sfile}, /* since Linux 3.4
 */
        {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 */
+
};

static void setup(void)
--
2.9.5

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180608/896f912e/attachment.html>
#2 lore raw

PATCH 1/2 madvise: add MADV_WIPEONFORK/MADV_KEEPONFORK in madvise() test

----- Original Message -----

Quoted 10 lines

ping

On Mon, May 14, 2018 at 5:26 PM, Li Wang < [email protected] > wrote:

The kernel commit (d2cd9ed mm,fork: introduce MADV_WIPEONFORK) introduces two new advices for madvise() in kernel-v4.14. Here making LTP cover that test accordingly.

Both pushed. I pushed an extra commit on top, to print advice that is being tested in madvise02.

Thanks,
Jan