($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] swapon01.c: Apply a margin to avoid oom
Date: Wed, 13 Mar 2024 21:33:20 -0400	[thread overview]
Message-ID: <20240314013320.5536-1-wegao@suse.com> (raw)

During our test i find a oom error during test which triggered by
tst_pollute_memory.

kernel: oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=/,mems_allowed=0-1,oom_memcg=/ltp/test-9552,task_memcg=/ltp/test-95520
kernel: Memory cgroup out of memory: Killed process 9575 (swapon01) total-vm:1051484kB, anon-rss:1046572kB, file-rss:1280kB, shmem-rss:0k0

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/syscalls/swapon/swapon01.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/swapon/swapon01.c b/testcases/kernel/syscalls/swapon/swapon01.c
index d406e4bd9..357992525 100644
--- a/testcases/kernel/syscalls/swapon/swapon01.c
+++ b/testcases/kernel/syscalls/swapon/swapon01.c
@@ -41,7 +41,9 @@ static void setup(void)
 	make_swapfile(SWAP_FILE, 10, 0);
 
 	SAFE_CG_PRINTF(tst_cg, "cgroup.procs", "%d", getpid());
-	SAFE_CG_PRINTF(tst_cg, "memory.max", "%lu", TESTMEM);
+
+	/* Apply a margin to avoid oom during tst_pollute_memory */
+	SAFE_CG_PRINTF(tst_cg, "memory.max", "%lu", TESTMEM + TESTMEM/100);
 }
 
 static struct tst_test test = {
-- 
2.35.3


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

             reply	other threads:[~2024-03-14  1:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  1:33 Wei Gao via ltp [this message]
2024-03-14  6:40 ` [LTP] [PATCH v1] swapon01.c: Apply a margin to avoid oom Li Wang
2024-03-15  1:30   ` Wei Gao via ltp
2024-03-15  3:17     ` Li Wang
2024-03-15  3:44       ` Wei Gao via ltp
2024-03-15  4:09         ` Li Wang
2024-03-15  4:19           ` Li Wang
2024-03-15  5:24             ` Wei Gao via ltp
2024-03-15  5:56               ` Li Wang
2024-03-15  6:24                 ` [LTP] [PATCH] swapon01: swapon01: prevent OOM happening in swap process Li Wang
2024-03-15  7:44                   ` Wei Gao via ltp
2024-03-15  8:36                     ` Li Wang
2024-03-15 10:52                       ` Wei Gao via ltp
2024-03-17  9:52                         ` Li Wang
2024-03-18  3:20                           ` Wei Gao via ltp
2024-03-18  6:32                             ` Li Wang
2024-03-18  7:02                               ` Wei Gao via ltp
2024-03-18  7:26                                 ` Li Wang
2024-03-18 12:39                                   ` Wei Gao via ltp
2024-03-19  3:28                                     ` Li Wang
2024-03-19  5:03                                       ` Petr Vorel
2024-03-19  5:43                                         ` Li Wang
2024-03-19  5:51                                           ` Li Wang
2024-03-19  7:29                                             ` Wei Gao via ltp
2024-03-19  8:18                                               ` Li Wang
2024-03-19  9:20                                                 ` Wei Gao via ltp
2024-03-19 19:24                                             ` Petr Vorel
2024-03-19 19:23                                           ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240314013320.5536-1-wegao@suse.com \
    --to=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).