From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] getrusage03: skip on small RAM system
Date: Mon, 7 Feb 2022 12:04:47 +0800 [thread overview]
Message-ID: <20220207040447.2803113-1-liwang@redhat.com> (raw)
It is easy to get VmSwap increase with a small system, here is
run with a 1G RAM kvm guest and TBROK:
7 tst_test.c:1365: TINFO: Timeout per run is 0h 05m 00s
8 getrusage03.c:43: TPASS: initial.self ~= child.self
9 getrusage03.c:57: TPASS: initial.children ~= 100MB
10 getrusage03.c:66: TPASS: child.children == 0
11 getrusage03.c:84: TPASS: child.children ~= 300MB
12 getrusage03.c:104: TPASS: initial.children ~= pre_wait.children
13 getrusage03.c:112: TPASS: post_wait.children ~= 400MB
14 getrusage03.h:25: TBROK: VmSwap is not zero
15 getrusage03.c:133: TPASS: initial.children ~= after_zombie.children
16 getrusage03.h:25: TBROK: VmSwap is not zero
17 getrusage03_child.c:57: TPASS: initial.self ~= exec.self
18 getrusage03_child.c:62: TPASS: initial.children ~= exec.children
Signed-off-by: Li Wang <liwang@redhat.com>
---
Notes:
Ps. I also think we might need .min_mem_[avai|total] field but
not sure if it is really necessary to add that.
testcases/kernel/syscalls/getrusage/getrusage03.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/testcases/kernel/syscalls/getrusage/getrusage03.c b/testcases/kernel/syscalls/getrusage/getrusage03.c
index bf5127483..5aa0b2326 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage03.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage03.c
@@ -173,6 +173,14 @@ static void run(unsigned int i)
}
}
+static void setup(void)
+{
+ long long mem_avail = tst_available_mem();
+
+ if (mem_avail < 512L*1024)
+ tst_brk(TCONF, "Needed > 512MB availabe, only have: %ld kB", mem_avail);
+}
+
static struct tst_test test = {
.forks_child = 1,
.child_needs_reinit = 1,
@@ -182,6 +190,7 @@ static struct tst_test test = {
{"linux-git", "1f10206cf8e9"},
{}
},
+ .setup = setup,
.test = run,
.tcnt = ARRAY_SIZE(testfunc_list),
};
--
2.31.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2022-02-07 4:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 4:04 Li Wang [this message]
2022-02-07 7:40 ` [LTP] [PATCH] getrusage03: skip on small RAM system Petr Vorel
2022-02-07 10:08 ` Li Wang
2022-02-07 11:12 ` Petr Vorel
2022-02-07 9:16 ` Jan Stancek
2022-02-07 12:09 ` Li Wang
2022-02-07 13:16 ` Cyril Hrubis
2022-02-08 3:27 ` Li Wang
2022-02-07 13:19 ` Cyril Hrubis
2022-02-08 3:21 ` 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=20220207040447.2803113-1-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