From: Cyril Hrubis <chrubis@suse.cz>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/set_mempolicy04: fix node available memory check
Date: Thu, 19 May 2022 11:50:02 +0200 [thread overview]
Message-ID: <YoYSyilDnoypaFXF@yuki> (raw)
In-Reply-To: <47bc8106e2c6f59e297e7cdabea3eef16e65cf44.1652950191.git.jstancek@redhat.com>
Hi!
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> index 4399503c3054..2a1d2e1b9ad0 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> @@ -40,9 +40,11 @@ static struct tst_nodemap *nodes;
>
> static void setup(void)
> {
> + int node_min_pages = FILES * (FILES + 1) / 2 * 10 + FILES * 10;
^ ^
10 * sum of 1 .. FILES |
And I guess this is
upper bound for
FILES * (j%10)
Looks good. I guess that I forget to update the estimate when the
allocation pattern got more complex.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Also I guess that this should go in before the release.
> page_size = getpagesize();
>
> - nodes = tst_get_nodemap(TST_NUMA_MEM, 20 * FILES * page_size / 1024);
> + nodes = tst_get_nodemap(TST_NUMA_MEM, node_min_pages * page_size / 1024);
> if (nodes->cnt <= 1)
> tst_brk(TCONF, "Test requires at least two NUMA memory nodes");
> }
> --
> 2.27.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-05-19 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 8:51 [LTP] [PATCH] syscalls/set_mempolicy04: fix node available memory check Jan Stancek
2022-05-19 9:50 ` Cyril Hrubis [this message]
2022-05-19 9:55 ` Jan Stancek
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=YoYSyilDnoypaFXF@yuki \
--to=chrubis@suse.cz \
--cc=jstancek@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