All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] move_pages12: compacting memory before each test loop
Date: Wed, 21 Feb 2024 17:27:54 +0100	[thread overview]
Message-ID: <20240221162754.GA1270838@pevik> (raw)
In-Reply-To: <20240220091328.2946023-1-liwang@redhat.com>

Hi Li,

> These simple steps are added to prepare the system's memory state
> for the test, aiming to increase the test's reliability and
> consistency by starting from a clean and defragmented memory state.

> To reduce accidental failures on small (1.5G) RAM system:

>   7 tst_test.c:1558: TINFO: Timeout per run is 0h 21m 00s
>   8 move_pages12.c:273: TINFO: Free RAM 1542656 kB
>   9 move_pages12.c:289: TINFO: Increasing 16384kB hugepages pool on node 0 to 4
>   10 move_pages12.c:299: TINFO: Increasing 16384kB hugepages pool on node 1 to 4
>   11 move_pages12.c:216: TINFO: Allocating and freeing 4 hugepages on node 0
>   12 move_pages12.c:216: TINFO: Allocating and freeing 4 hugepages on node 1
>   13 move_pages12.c:207: TPASS: Bug not reproduced
>   14 move_pages12.c:106: TFAIL: madvise failed: ENOMEM (12)
>   ...<repeats 741 times>...
>   756 move_pages12.c:207: TPASS: Bug not reproduced

> Note:
>   This is a single hugetlb test without invoking the hugetlb-lib of LTP,
>   so we add the compacting memory/cache steps additionally.

> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/syscalls/move_pages/move_pages12.c | 3 +++
>  1 file changed, 3 insertions(+)

> diff --git a/testcases/kernel/syscalls/move_pages/move_pages12.c b/testcases/kernel/syscalls/move_pages/move_pages12.c
> index fd7017d79..c387a326f 100644
> --- a/testcases/kernel/syscalls/move_pages/move_pages12.c
> +++ b/testcases/kernel/syscalls/move_pages/move_pages12.c
> @@ -154,6 +154,9 @@ static void do_test(unsigned int n)
>  	pid_t cpid = -1;
>  	int status;

> +	SAFE_FILE_PRINTF("/proc/sys/vm/drop_caches", "3");
> +	SAFE_FILE_PRINTF("/proc/sys/vm/compact_memory", "1");

LGTM
Reviewed-by: Petr Vorel <pvorel@suse.cz>

BTW we clear cache with /proc/sys/vm/drop_caches in quite a few files,
I wonder if it would make sense to add a helper for it. Likely not
(it's oneliner).

Kind regards,
Petr

> +
>  	addr = SAFE_MMAP(NULL, tcases[n].tpages * hpsz, PROT_READ | PROT_WRITE,
>  		MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0);

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

  reply	other threads:[~2024-02-21 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  9:13 [LTP] [PATCH] move_pages12: compacting memory before each test loop Li Wang
2024-02-21 16:27 ` Petr Vorel [this message]
2024-02-22  3:38   ` 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=20240221162754.GA1270838@pevik \
    --to=pvorel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.