All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] memcontrol03: Using clean page cache to avoid dependency on IO rate
Date: Fri, 15 Mar 2024 10:17:03 +0100	[thread overview]
Message-ID: <20240315091703.GC171573@pevik> (raw)
In-Reply-To: <20240315033139.20557-1-wegao@suse.com>

Hi Wei,

> Bad IO situation(storage bandwidth ~10MB/sec) will lead background
> writeback has uncertain progress for dirty page. So system can not
> reclaim enough memory for new process and finally lead a unexpected
> OOM.

Use fsync() to make sure that the pages from the file we wrote into are written
to a permanent storage.

> memcontrol03.c:218: TPASS: Expect: (A/B/E memory.current=0) ~= 0
> memcontrol03.c:116: TPASS: Child 1918 killed by OOM
> memcontrol03.c:224: TPASS: Expect: (A/B memory.current=52588544) ~= 52428800
> memcontrol03.c:129: TFAIL: Expected child 1944 to exit(0), but instead killed by SIGKILL

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
(Please do this yourself next time)

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1218178

Kind regards,
Petr

> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  testcases/kernel/controllers/memcg/memcontrol03.c | 1 +
>  1 file changed, 1 insertion(+)

> diff --git a/testcases/kernel/controllers/memcg/memcontrol03.c b/testcases/kernel/controllers/memcg/memcontrol03.c
> index 9c6c808e0..e2fc85cc8 100644
> --- a/testcases/kernel/controllers/memcg/memcontrol03.c
> +++ b/testcases/kernel/controllers/memcg/memcontrol03.c
> @@ -144,6 +144,7 @@ static void alloc_pagecache_in_child(const struct tst_cg_group *const cg,
>  	tst_res(TINFO, "Child %d in %s: Allocating pagecache: %"PRIdPTR,
>  		getpid(), tst_cg_group_name(cg), size);
>  	alloc_pagecache(fd, size);
> +	SAFE_FSYNC(fd);

>  	TST_CHECKPOINT_WAKE(CHILD_IDLE);
>  	TST_CHECKPOINT_WAIT(TEST_DONE);

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

  reply	other threads:[~2024-03-15  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  2:33 [LTP] [PATCH v1] memcontrol03: Using clean page cache to avoid dependency on IO rate Wei Gao via ltp
2024-03-14 11:24 ` Cyril Hrubis
2024-03-14 15:46 ` Cyril Hrubis
2024-03-15  3:31 ` [LTP] [PATCH v2] " Wei Gao via ltp
2024-03-15  9:17   ` Petr Vorel [this message]
2024-03-15  9:28     ` Petr Vorel

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=20240315091703.GC171573@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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.