From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] oom: enable lite == 1 for memory.swap.max testing
Date: Mon, 21 Jun 2021 19:15:09 +0800 [thread overview]
Message-ID: <20210621111509.358656-2-liwang@redhat.com> (raw)
In-Reply-To: <20210621111509.358656-1-liwang@redhat.com>
oom03: adding print info and restore memory.swap.max after testing
oom05: enable lite == 1 for memory.swap.max testing
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/kernel/mem/oom/oom03.c | 7 +++++++
testcases/kernel/mem/oom/oom05.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c
index 939413744..8d78f3d26 100644
--- a/testcases/kernel/mem/oom/oom03.c
+++ b/testcases/kernel/mem/oom/oom03.c
@@ -46,8 +46,15 @@ static void verify_oom(void)
testoom(0, 0, ENOMEM, 1);
if (SAFE_CGROUP_HAS(cg, "memory.swap.max")) {
+ tst_res(TINFO, "OOM on MEMCG with special memswap limitation:");
SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", TESTMEM);
+
testoom(0, 1, ENOMEM, 1);
+
+ if (TST_CGROUP_VER(cg, "memory") == TST_CGROUP_V1)
+ SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", ~0UL);
+ else
+ SAFE_CGROUP_PRINT(cg, "memory.swap.max", "max");
}
/* OOM for MEMCG with mempolicy */
diff --git a/testcases/kernel/mem/oom/oom05.c b/testcases/kernel/mem/oom/oom05.c
index 9c9bba7f6..a25dc6560 100644
--- a/testcases/kernel/mem/oom/oom05.c
+++ b/testcases/kernel/mem/oom/oom05.c
@@ -64,7 +64,7 @@ static void verify_oom(void)
tst_res(TINFO, "OOM on CPUSET & MEMCG with "
"special memswap limitation:");
SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", TESTMEM);
- testoom(0, 0, ENOMEM, 1);
+ testoom(0, 1, ENOMEM, 1);
tst_res(TINFO, "OOM on CPUSET & MEMCG with "
"disabled memswap limitation:");
--
2.31.1
next prev parent reply other threads:[~2021-06-21 11:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 11:15 [LTP] [PATCH 1/2] mem: child memory alloc should larger than memory.max+memory.swap.max if lite==1 Li Wang
2021-06-21 11:15 ` Li Wang [this message]
2021-06-21 14:04 ` Li Wang
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=20210621111509.358656-2-liwang@redhat.com \
--to=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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