Skip to content

mm: Add readahead support for IOCB_NOWAIT

Yafang Shao linux-fsdevel linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 23 repliesIn review

Changes from the cover letter

- fs: Add a new flag RWF_IOWAIT for preadv2(2)
https://lore.kernel.org/linux-fsdevel/[email protected]/ [0]

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm: Add memalloc_nowait_{save,restore}include/linux/sched/mm.h+30 -034 replies
2/2mm: allow read-ahead with IOCB_NOWAIT setinclude/linux/fs.h mm/filemap.c+6 -10 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchYafang ShaoChristoph Hellwig
1/2A-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] mm: Add readahead support for IOCB_NOWAIT

We have use cases where we want to trigger readahead in preadv2(2) with RWF_NOWAIT set [0].

Readahead support was originally added for IOCB_NOWAIT in commit 2e85abf053b9 ("mm: allow read-ahead with IOCB_NOWAIT set"). However, this behavior was modified in commit efa8480a8316 ("fs: RWF_NOWAIT should imply IOCB_NOIO") due to concerns about potential blocking during memory reclamation.

To prevent blocking on memory reclamation, we can utilize memalloc_nowait_{save,restore} to ensure non-blocking behavior. By restoring the original behavior, we can allow preadv2(IOCB_NOWAIT) to read data directly from disk if it's not already in the page cache.

Changes:
- fs: Add a new flag RWF_IOWAIT for preadv2(2)
https://lore.kernel.org/linux-fsdevel/[email protected]/ [0]

Yafang Shao (2):
mm: Add memalloc_nowait_{save,restore}
mm: allow read-ahead with IOCB_NOWAIT set

 include/linux/fs.h       |  1 -
 include/linux/sched/mm.h | 30 ++++++++++++++++++++++++++++++
 mm/filemap.c             |  6 ++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.5