Re: [PATCH] selftests/mm: add folio_split() and filemap_get_entry() race test
From: Andrew Morton
Date: Sat Mar 14 2026 - 18:28:12 EST
On Fri, 13 Mar 2026 07:40:37 -0400 Zi Yan <ziy@xxxxxxxxxx> wrote:
> The added folio_split_race_test is a modified C port of the race condition
> test from [1]. The test creates shmem huge pages shared by both a parent
> and a child processes, where the parent process punches holes in the shmem
> to cause folio_split() in the kernel and the child process reads the shmem
> in 16 threads to cause filemap_get_entry() in the kernel.
> filemap_get_entry() reads the folio and xarray split by folio_split()
> locklessly. The original test[2] is written in rust and uses memfd (shmem
> backed). This C port uses shmem directly.
Cool.
> Note: the initial rust to C conversion is done by Cursor.
Hence the CaMeLcAsE "struct SharedCtl". Fair enough.
> Link: https://lore.kernel.org/all/CAKNNEtw5_kZomhkugedKMPOG-sxs5Q5OLumWJdiWXv+C9Yct0w@xxxxxxxxxxxxxx/ [1]
> Link: https://github.com/dfinity/thp-madv-remove-test [2]
I couldn't immediately find any licensing info there. Bas and Adam,
please advise? And sending your Signed-off-by's would be appropriate.
Thanks.