Re: [PATCH v3] selftests/mm: add folio_split() and filemap_get_entry() race test
From: Lorenzo Stoakes (Oracle)
Date: Fri Mar 20 2026 - 13:53:59 EST
(-cc old email)
On Thu, Mar 19, 2026 at 03:04:08PM -0400, Zi Yan 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, where the main thread
> punches holes in the shmem to cause folio_split() in the kernel and
> a set of 16 threads reads the shmem 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 and use a single
> process.
>
> Note: the initial rust to C conversion is done by Cursor.
>
> Link: https://lore.kernel.org/all/CAKNNEtw5_kZomhkugedKMPOG-sxs5Q5OLumWJdiWXv+C9Yct0w@xxxxxxxxxxxxxx/ [1]
> Link: https://github.com/dfinity/thp-madv-remove-test [2]
> Signed-off-by: Bas van Dijk <bas@xxxxxxxxxxx>
> Signed-off-by: Adam Bratschi-Kaye <adam.bratschikaye@xxxxxxxxxxx>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
No .gitignore entry? :)
(Just saw it flag up locally in git status)
Linus says don't remove, but he doesn't say don't add :P
Cheers, Lorenzo