Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] mmapstress06: Rate limit page-dirtying loop to prevent MemCG OOM-kills
@ 2026-08-25  2:13 Wei Gao via ltp
  2026-08-25  3:00 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Wei Gao via ltp @ 2026-08-25  2:13 UTC (permalink / raw)
  To: ltp

Reduce the throttling interval from 2 MB to 64 KB (usleep for 200us
every 64 KB) in the page-dirtying loop. This smooths out allocation
spikes and gives asynchronous swap writeback time to catch up under
slower VM storage environments, avoiding unexpected MemCG OOM-kills.

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/mem/mmapstress/mmapstress06.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/mmapstress/mmapstress06.c b/testcases/kernel/mem/mmapstress/mmapstress06.c
index 4e6023399..2813ef185 100644
--- a/testcases/kernel/mem/mmapstress/mmapstress06.c
+++ b/testcases/kernel/mem/mmapstress/mmapstress06.c
@@ -57,10 +57,14 @@ static void run_test(void)
 
 		tst_res(TINFO, "Dirtying %zu bytes in child", map_size);
 
+		/*
+		 * Yield periodically to space out allocation spikes and allow
+		 * asynchronous swap writeback to catch up on slower VM disks.
+		 */
 		for (size_t i = 0; i < map_size; i += page_size) {
 			mmapaddr[i] = 'a';
-			if ((i % (2 * 1024 * 1024)) == 0)
-				usleep(1000);
+			if ((i % (64 * 1024)) == 0)
+				usleep(200);
 		}
 
 		SAFE_CG_SCANF(cg_child, "memory.swap.current", "%lu", &cg_swap_after);
-- 
2.55.0


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

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-09-04 10:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  2:13 [LTP] [PATCH v1] mmapstress06: Rate limit page-dirtying loop to prevent MemCG OOM-kills Wei Gao via ltp
2026-08-25  3:00 ` [LTP] " linuxtestproject.agent
2026-08-25 12:16 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp
2026-08-26  7:13   ` Wei Gao via ltp
2026-08-26  7:58     ` Andrea Cervesato via ltp
2026-08-26  9:31       ` Wei Gao via ltp
2026-08-26  9:49         ` Andrea Cervesato via ltp
2026-08-26 13:38           ` Wei Gao via ltp
2026-08-27  8:06             ` Andrea Cervesato via ltp
2026-08-27 14:21               ` Cyril Hrubis
2026-09-01  2:04                 ` Wei Gao via ltp
2026-09-01  7:38                   ` Andrea Cervesato via ltp
2026-09-01  8:22                     ` Wei Gao via ltp
2026-09-01  8:47                   ` Cyril Hrubis
2026-09-02  2:57 ` [LTP] [PATCH v2] mmapstress06: Use memory.high in cgroup v2 to start swapping early Wei Gao via ltp
2026-09-02  8:28   ` [LTP] " linuxtestproject.agent
2026-09-04  8:53   ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-09-04 10:23   ` Cyril Hrubis
2026-09-04 10:43   ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox