Linux Test Project
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@linux.ibm.com>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] mem/min_free_kbytes: Fix incorrect pass/fail accounting
Date: Fri, 10 Jul 2026 10:38:41 +0530	[thread overview]
Message-ID: <c76d95ec-6598-450e-8601-b737d3cba0a8@linux.ibm.com> (raw)
In-Reply-To: <6a4fd5b9.a1b3dc3f.1e550b.63db@mx.google.com>



On 09/07/26 10:39 pm, Andrea Cervesato wrote:
> Hi Sachin,
>
> I think with this patch we are working around the problem. Which is..
> the test is badly written and it needs a complete refactoring, since
> it seems like a mix of old and new API.

Hi Andrea,

Thank you for the detailed review.

You are right — the original patch was a workaround rather than a proper
fix.  The test was mixing old bare-fork patterns with the newer LTP API,
and patching around the symptom without addressing the structural problem
was the wrong approach.

I will rework the patch as a full refactor addressing all points raised:

1. Extract a set_min_free_kbytes() helper that consolidates the three
    tune-selection cases using a switch statement and MIN() as suggested,
    replacing the open-coded if/else if/else block in test_tune().

2. Replace all bare fork() calls with SAFE_FORK() throughout.  The
    eatup_mem children in test_tune() are still waited with SAFE_WAITPID
    and their exit status is still inspected per-policy, because
    overcommit_policy=1 expects SIGKILL — delegating those to
    tst_reap_children() would incorrectly produce TBROK on a valid
    outcome.

3. Drop the SAFE_WAITPID on the monitor child and its status check
    from min_free_kbytes_test() entirely.  The monitor child reports its
    own TPASS/TFAIL via tst_res() and always exits 0, so the framework's
    tst_reap_children() (called automatically after test_all returns)
    handles it correctly without any duplicate logic in the test.

4. Revise the commit message to be short and self-explanatory without
    re-narrating the diff.

I will send a v3 with the changes included.

-- 
Thanks
- Sachin



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

      reply	other threads:[~2026-07-10  5:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  4:13 [LTP] [PATCH v2] mem/min_free_kbytes: Fix incorrect pass/fail accounting Sachin Sant
2026-07-09  6:52 ` [LTP] " linuxtestproject.agent
2026-07-09 17:09 ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-07-10  5:08   ` Sachin Sant [this message]

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=c76d95ec-6598-450e-8601-b737d3cba0a8@linux.ibm.com \
    --to=sachinp@linux.ibm.com \
    --cc=andrea.cervesato@suse.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