Skip to contentSkip to conversation

madvice: new case for madvise(WILLNEED)

PATCH New Li Wang 2 participants 2 messages Apr 5, 2016 – Apr 6, 2016

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH v4 1/1 madvice: new case for madvise(WILLNEED)

Page fault occurs in spite that madvise(WILLNEED) system call is called to prefetch the page. This issue is reproduced by running a program which sequentially accesses to a shared memory and calls madvise(WILLNEED) to the next page on a page fault.

Fixed by commit:
55231e5c898 mm: madvise: fix MADV_WILLNEED on shmem swapouts

---

Notes:

    V3 --> V4
    * cancel the limitaion of architecture
      (test good on x86_64, ppc64 and s390x)
 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/.gitignore          |   1 +
 testcases/kernel/syscalls/madvise/madvise06.c | 148 ++++++++++++++++++++++++++
 3 files changed, 150 insertions(+)
 create mode 100644 testcases/kernel/syscalls/madvise/madvise06.c
runtest/syscalls +1 -0
index b41c927..732c2ca 100644
@@ -743,6 +743,7 @@ madvise02 madvise02
 madvise03 madvise03
 madvise04 madvise04
 madvise05 madvise05
+madvise06 madvise06
 
 newuname01 newuname01
 
testcases/kernel/syscalls/.gitignore +1 -0
index 0540928..ffa5db1 100644
@@ -504,6 +504,7 @@
 /madvise/madvise03
 /madvise/madvise04
 /madvise/madvise05
+/madvise/madvise06
 /mallopt/mallopt01
 /mbind/mbind01
 /memcmp/memcmp01
testcases/kernel/syscalls/madvise/madvise06.c new file +148 -0

148 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v4 1/1 madvice: new case for madvise(WILLNEED)

Hi!

testcases/kernel/syscalls/madvise/madvise06.c line 124

Quoted 3 lines
testcases/kernel/syscalls/madvise/madvise06.c new file +3 -0
+	tst_resm(TINFO, "PageFault(no madvice): %d", get_page_fault_num());
+
+	pg_sz = getpagesize();

I've moved this getpagesize() to setup() since we don't have to call it each test iteration and pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]