Re: [PATCH v3] selftests/mm: add folio_split() and filemap_get_entry() race test
From: Andrew Morton
Date: Thu Mar 19 2026 - 22:41:31 EST
On Thu, 19 Mar 2026 15:04:08 -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, 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.
Sashiko has questions:
https://sashiko.dev/#/patchset/20260319190409.294523-1-ziy%40nvidia.com
(this is getting painful :(. I hope they're worthwhile)