Skip to contentSkip to conversation

syscalls/madvise06: Add madvise WILLNEED performance problem tag

PATCH New Yang Xu 2 participants 3 messages Aug 3, 2021 – Aug 4, 2021

lore
Share & tools
lore

Yang Xu

author
#0 lore raw

PATCH 1/1 syscalls/madvise06: Add madvise WILLNEED performance problem tag

When running this case on 5.10-rc1 kernel, it will trigger the following failure
......
madvise06.c:74: TINFO: memory.kmem.usage_in_bytes: 1752 Kb madvise06.c:208: TPASS: more than 102400 Kb were moved to the swap cache madvise06.c:217: TINFO: PageFault(madvice / no mem access): 102400 madvise06.c:221: TINFO: PageFault(madvice / mem access): 105600 madvise06.c:82: TINFO: After page access

madvise06.c:84: TINFO:  Swap: 307540 Kb
madvise06.c:86: TINFO:  SwapCached: 100480 Kb
madvise06.c:88: TINFO:  Cached: 102056 Kb
madvise06.c:74: TINFO:  memory.current: 204636 Kb
madvise06.c:74: TINFO:  memory.swap.current: 411476 Kb
madvise06.c:74: TINFO:  memory.kmem.usage_in_bytes: 1752 Kb

madvise06.c:226: TFAIL: 3200 pages were faulted out of 2 max

It fails because of madvise WILLNEED performance problem, so add the introduced and fixed commit.

---
 testcases/kernel/syscalls/madvise/madvise06.c | 8 ++++++++
 1 file changed, 8 insertions(+)
testcases/kernel/syscalls/madvise/madvise06.c +8 -0
index 63d8d5452..f2f65ff96 100644
@@ -35,6 +35,12 @@
  * faults. Two faults are allowed incase some tasklet or something
  * else unexpected, but irrelevant procedure, registers a fault to
  * our process.
+ *
+ * It also can reproduce the MADV_WILLNEED preformance problem.
+ * It was introduced since 5.9 kernel with the following commit
+ *   e6e88712e43b ("mm: optimise madvise WILLNEED")
+ * and fixed since 5.10-rc5 kernel with the following commit
+ *   66383800df9c ("mm: fix madvise WILLNEED performance problem").
  */
 
 #include <errno.h>
@@ -242,6 +248,8 @@ static struct tst_test test = {
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "55231e5c898c"},
 		{"linux-git", "8de15e920dc8"},
+		{"linux-git", "e6e88712e43b"},
+		{"linux-git", "66383800df9c"},
 		{}
 	}
 };
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 syscalls/madvise06: Add madvise WILLNEED performance problem tag

Hi!

Quoted 18 lines
testcases/kernel/syscalls/madvise/madvise06.c +6 -0
index 63d8d5452..f2f65ff96 100644
@@ -35,6 +35,12 @@
  * faults. Two faults are allowed incase some tasklet or something
  * else unexpected, but irrelevant procedure, registers a fault to
  * our process.
+ *
+ * It also can reproduce the MADV_WILLNEED preformance problem.
+ * It was introduced since 5.9 kernel with the following commit
+ *   e6e88712e43b ("mm: optimise madvise WILLNEED")
+ * and fixed since 5.10-rc5 kernel with the following commit
+ *   66383800df9c ("mm: fix madvise WILLNEED performance problem").
  */
 
 #include <errno.h>

testcases/kernel/syscalls/madvise/madvise06.c static struct tst_test test = { · line 252

Quoted 5 lines
testcases/kernel/syscalls/madvise/madvise06.c +2 -0
@@ -242,6 +248,8 @@ static struct tst_test test = {
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "55231e5c898c"},
 		{"linux-git", "8de15e920dc8"},
+		{"linux-git", "e6e88712e43b"},
+		{"linux-git", "66383800df9c"},

We only put patches that fixed the problem into the tags since we use these to print failure hints about missing kernel patches.

Other than that it looks fine.

Quoted 9 lines
testcases/kernel/syscalls/madvise/madvise06.c +0 -0
 		{}
 	}
 };
Signature · 5 lines
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

PATCH 1/1 syscalls/madvise06: Add madvise WILLNEED performance problem tag

Hi Cyril

Quoted 17 lines

Hi!

Quoted 16 lines
testcases/kernel/syscalls/madvise/madvise06.c +6 -0
index 63d8d5452..f2f65ff96 100644
@@ -35,6 +35,12 @@
   * faults. Two faults are allowed incase some tasklet or something
   * else unexpected, but irrelevant procedure, registers a fault to
   * our process.
+ *
+ * It also can reproduce the MADV_WILLNEED preformance problem.
+ * It was introduced since 5.9 kernel with the following commit
+ *   e6e88712e43b ("mm: optimise madvise WILLNEED")
+ * and fixed since 5.10-rc5 kernel with the following commit
+ *   66383800df9c ("mm: fix madvise WILLNEED performance problem").
   */
 
Quoted 10 lines

testcases/kernel/syscalls/madvise/madvise06.c static struct tst_test test = { · line 252

Quoted 7 lines
testcases/kernel/syscalls/madvise/madvise06.c +2 -0
  #include<errno.h>
@@ -242,6 +248,8 @@ static struct tst_test test = {
  	.tags = (const struct tst_tag[]) {
  		{"linux-git", "55231e5c898c"},
  		{"linux-git", "8de15e920dc8"},
+		{"linux-git", "e6e88712e43b"},
+		{"linux-git", "66383800df9c"},

We only put patches that fixed the problem into the tags since we use these to print failure hints about missing kernel patches.

Oh, yes. Thanks for your review, I merged this patch with removing introduced patch tag.

Best Regards
Yang Xu

Quoted 13 lines

Other than that it looks fine.

Quoted 9 lines
testcases/kernel/syscalls/madvise/madvise06.c +0 -1
  		{}
  	}
  };
--

2.23.0

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