Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xu Xin (vivo)" <xu.xin@linux.dev>
Cc: akpm@linux-foundation.org, chengming.zhou@linux.dev,
	david@kernel.org, donettom@linux.ibm.com, linux-mm@kvack.org
Subject: Re: [PATCH v3 2/3] selftests/mm: fix false-positive and racy KSM fork test
Date: Tue, 24 Nov 2026 03:46:08 +0000	[thread overview]
Message-ID: <sashiko-outbox-230483@kernel.org> (raw)
In-Reply-To: <20261123034517.236914-1-xu.xin@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/mm: missing Fixes trailer for
  test_fork_ksm_merging_page_count() fix
--

commit 083e2e9d04935c2fa0f5fe274b48231b2239b2c4
Author: Xu Xin (vivo) <xu.xin@linux.dev>

> selftests/mm: fix false-positive and racy KSM fork test
>
> Currently, test_fork_ksm_merging_page_count() passes wrongly even if
> fork() fails to reset mm->ksm_merging_pages, because the child process
> calls init_global_file_handles() -> ksm_stop(), which unmerges all KSM
> pages across the system before reading its counters.
>
> Fix three issues in test_fork_ksm_merging_page_count():
>
> - Drop init_global_file_handles() in the child process so it does not
>   call ksm_stop() and mutate global KSM sysfs state (unmerging all KSM
>   pages across the system) before reading its counters.
>
> - Use '!!' in exit(!!ksm_get_self_merging_pages()) to avoid 8-bit exit
>   status truncation (e.g., 512 pages on 4 KiB systems truncating to 0).
>
> - Introduce ksm_pause() to pause ksmd (write "0" to /sys/kernel/mm/ksm/run)
>   before fork(), preventing ksmd from scanning the child and incrementing
>   its counter before it is read.
>
> Signed-off-by: Xu Xin (vivo) <xu.xin@linux.dev>

[Severity: Low]
This fixes defects in test_fork_ksm_merging_page_count().  Should the commit
message include:

  Fixes: 08ff89b5659d ("selftests/mm: add fork inheritance test for ksm_merging_pages counter")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123034136.209410-1-xu.xin@linux.dev?part=2


  parent reply	other threads:[~2026-11-24  3:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  3:41 [PATCH v3 0/3] mm/ksm: fix ksm_zero_pages accounting on fork Xu Xin (vivo)
2026-11-23  3:43 ` [PATCH v3 1/3] mm/ksm: do not inherit ksm_zero_pages counter or PTE markers " Xu Xin (vivo)
2026-11-23  3:43 ` Xu Xin (vivo)
2026-11-23 16:38   ` David Hildenbrand (Arm)
2026-11-23  3:45 ` [PATCH v3 2/3] selftests/mm: fix false-positive and racy KSM fork test Xu Xin (vivo)
2026-11-23 16:43   ` David Hildenbrand (Arm)
2026-11-24  3:46   ` sashiko-bot [this message]
2026-11-23  3:45 ` [PATCH v3 3/3] selftests/mm: verify ksm_zero_pages is not inherited on fork Xu Xin (vivo)
2026-11-23 16:49   ` David Hildenbrand (Arm)
2026-11-24  2:45     ` Xu Xin (vivo)

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=sashiko-outbox-230483@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=david@kernel.org \
    --cc=donettom@linux.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xu.xin@linux.dev \
    /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