From: "David Hildenbrand (Arm)" <david@kernel.org>
To: sashiko-reviews@lists.linux.dev, "Xu Xin (vivo)" <xu.xin@linux.dev>
Cc: akpm@linux-foundation.org, chengming.zhou@linux.dev,
donettom@linux.ibm.com, linux-mm@kvack.org
Subject: Re: [PATCH v4 2/3] selftests/mm: fix false-positive and racy KSM fork test
Date: Wed, 25 Nov 2026 14:32:46 +0100 [thread overview]
Message-ID: <2382beac-077f-4393-89ad-580bd09a6314@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-233438@kernel.org>
On 11/25/26 14:04, sashiko-bot@kernel.org wrote:
> 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 9f91c40f8740268fa4e48f24e3a50d43177b045b
> 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>
>> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
>
> [Severity: Low]
> Since this fixes defects in test_fork_ksm_merging_page_count(), should it
> include a Fixes: tag for the commit that introduced the test?
>
> Fixes: 08ff89b5659d ("selftests/mm: add fork inheritance test for ksm_merging_pages counter")
Yeah, makes sense.
--
Cheers,
David
next prev parent reply other threads:[~2026-11-25 13:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 13:01 [PATCH v4 0/3] mm/ksm: fix ksm_zero_pages accounting on fork Xu Xin (vivo)
2026-11-24 13:03 ` [PATCH v4 1/3] mm/ksm: do not inherit ksm_zero_pages counter or PTE markers " Xu Xin (vivo)
2026-11-25 10:32 ` David Hildenbrand (Arm)
2026-11-24 13:03 ` [PATCH v4 2/3] selftests/mm: fix false-positive and racy KSM fork test Xu Xin (vivo)
2026-11-25 13:04 ` sashiko-bot
2026-11-25 13:32 ` David Hildenbrand (Arm) [this message]
2026-11-24 13:03 ` [PATCH v4 3/3] selftests/mm: verify ksm_zero_pages is not inherited on fork Xu Xin (vivo)
2026-11-25 10:34 ` David Hildenbrand (Arm)
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=2382beac-077f-4393-89ad-580bd09a6314@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--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 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.