[PATCH v2 0/2] mtd: rawnand: nandsim: stop pre-populating the cache file's page cache

From: Tal Zussman

Date: Fri Oct 16 2026 - 14:32:20 EST


nandsim runs its cache file I/O under PF_MEMALLOC and pre-populates the
page cache before each access, both to keep reclaim from coming back
into the MTD during kernel_read() and kernel_write(). Use
memalloc_noio_save() for that instead and remove the pre-population. The
pre-population is the driver's only struct page usage and one of the
last users of find_get_page() and find_or_create_page().

Tested on KVM using the MTD test modules, nandtest, and fsx/fsstress on
UBIFS over a nandsim cache file, with no errors and a 6-13% speedup in
mtd_speedtest.

---
Changes in v2:
- Patch 1: Use memalloc_noio_save() instead of memalloc_nofs_save(), per
Sashiko.
- Link to v1: https://patch.msgid.link/20261014-nandsim-nofs-v1-0-47e49f37e387@xxxxxxxxxxxx

---
Tal Zussman (2):
mtd: rawnand: nandsim: use a NOIO scope for cache file I/O
mtd: rawnand: nandsim: stop pre-populating the cache file's page cache

drivers/mtd/nand/raw/nandsim.c | 85 +++++++-----------------------------------
1 file changed, 14 insertions(+), 71 deletions(-)
---
base-commit: 30daaf3e7897b4a8d9b72e5b0c86dd6e2a4d7d85
change-id: 20261012-nandsim-nofs-8f3ae982181e

Best regards,
--
Tal Zussman <tz2294@xxxxxxxxxxxx>