From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] mem/min_free_kbytes: Add grace period for memory reclaim
Date: Fri, 29 May 2026 18:07:08 +0200 [thread overview]
Message-ID: <20260529160708.GA287653@pevik> (raw)
In-Reply-To: <ahcQd-5ffiCDU8IE@yuki.lan>
Hi all,
> > @@ -140,14 +140,13 @@ static void test_tune(unsigned long overcommit_policy)
> > } else {
> > if (WIFEXITED(status)) {
> > if (WEXITSTATUS(status) != 0) {
> > - tst_res(TFAIL, "child unexpectedly "
> > - "failed: %d", status);
> > + tst_res(TFAIL, "child unexpectedly failed: %d",
> > + status);
> We do have tst_strstatus().
+1, I fixed this as a separate change:
https://github.com/linux-test-project/ltp/commit/d81526f7da5645a04d6e03e557d3c829b67b3c57
> > }
> > } else if (!WIFSIGNALED(status) ||
> > WTERMSIG(status) != SIGKILL) {
> > - tst_res(TFAIL,
> > - "child unexpectedly failed: %d",
> > - status);
> > + tst_res(TFAIL, "child unexpectedly failed: %d",
> > + status);
> > }
> > }
> > }
> > @@ -183,18 +182,32 @@ static void check_monitor(void)
> > {
> > unsigned long tune;
> > unsigned long memfree;
> > + int i;
> > while (!end) {
> > memfree = SAFE_READ_MEMINFO("MemFree:");
> > tune = TST_SYS_CONF_LONG_GET(MIN_FREE_KBYTES);
> > if (memfree < tune) {
> > - tst_res(TINFO, "MemFree is %lu kB, "
> > - "min_free_kbytes is %lu kB", memfree, tune);
> > - tst_res(TFAIL, "MemFree < min_free_kbytes");
> > + /*
> > + * Give it some time to reclaim. The kernel should keep
> > + * MemFree above min_free_kbytes, but transient drops
> > + * are possible under high pressure.
> > + */
> > + for (i = 1; i < 1024; i *= 2) {
> > + usleep(i * 1000);
> > + memfree = SAFE_READ_MEMINFO("MemFree:");
> > + if (memfree >= tune)
> > + break;
> > + }
> > +
> > + if (memfree < tune) {
> > + tst_res(TFAIL, "MemFree %lu kB < min_free_kbytes %lu kB",
> > + memfree, tune);
> > + }
> > }
> Looks good.
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> I think that we also want to change the test so that the monitor is
> started and stopped for each testcase with a specific value we set the
> min_free_kbytes to. Running it asynchronously like this may mean that we
> will be looking for a wrong value for the second if we are unlucky. But
> that can be done later on.
@Wei Unfortunately this does not help on the current stable kernels (at least
not on 7.0.10 on Tumbleweed. We discussed it with Vlastimil Babka and Cyril
Hrubis and the conclusion is to start with running the monitor synchronously
with each subtestcase and making sure MemFree is big enough before we start the
monitor and the process that creates memory stress.
Also, please rebase when doing changes.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-05-29 16:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 5:08 [LTP] [PATCH v2] mem/min_free_kbytes: Add grace period for memory reclaim Wei Gao via ltp
2026-05-27 5:31 ` [LTP] " linuxtestproject.agent
2026-05-27 15:40 ` [LTP] [PATCH v2] " Cyril Hrubis
2026-05-29 16:07 ` Petr Vorel [this message]
2026-05-31 13:51 ` Wei Gao via ltp
2026-05-31 13:40 ` [LTP] [PATCH v3] min_free_kbytes: Handle transient memory drops in check_monitor Wei Gao via ltp
2026-06-01 6:42 ` [LTP] " linuxtestproject.agent
2026-06-02 1:00 ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-06-02 4:02 ` [LTP] " linuxtestproject.agent
2026-06-02 7:46 ` Wei Gao via ltp
2026-06-02 16:07 ` Andrea Cervesato via ltp
2026-06-03 3:07 ` Wei Gao via ltp
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=20260529160708.GA287653@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--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.