From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] getrusage03: skip on small RAM system
Date: Mon, 7 Feb 2022 14:19:42 +0100 [thread overview]
Message-ID: <YgEcbmGjGEaPgzAo@yuki> (raw)
In-Reply-To: <20220207040447.2803113-1-liwang@redhat.com>
Hi!
> ---
>
> Notes:
> Ps. I also think we might need .min_mem_[avai|total] field but
> not sure if it is really necessary to add that.
Actually this would be very useful from the long term perspective. If we
ever manage to run tests in parallel the scheduller should make sure
that we do not hit OOM due to running more than one processe that
consume significant amount of memory at the same time.
> 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),
> };
Looks good:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-02-07 13:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 4:04 [LTP] [PATCH] getrusage03: skip on small RAM system Li Wang
2022-02-07 7:40 ` 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 [this message]
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=YgEcbmGjGEaPgzAo@yuki \
--to=chrubis@suse.cz \
--cc=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