On 5/17/22 4:14 AM, Jan Kara wrote: > On Mon 16-05-22 09:47:06, Stefan Roesch wrote: >> This adds async buffered write support to iomap. The support is focused >> on the changes necessary to support XFS with iomap. >> >> Support for other filesystems might require additional changes. >> >> Signed-off-by: Stefan Roesch <shr@xxxxxx> >> --- >> fs/iomap/buffered-io.c | 21 ++++++++++++++++++++- >> 1 file changed, 20 insertions(+), 1 deletion(-) >> >> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c >> index 1ffdc7078e7d..ceb3091f94c2 100644 >> --- a/fs/iomap/buffered-io.c >> +++ b/fs/iomap/buffered-io.c >> @@ -580,13 +580,20 @@ static int __iomap_write_begin(const struct iomap_iter *iter, loff_t pos, >> size_t from = offset_in_folio(folio, pos), to = from + len; >> size_t poff, plen; >> gfp_t gfp = GFP_NOFS | __GFP_NOFAIL; >> + bool no_wait = (iter->flags & IOMAP_NOWAIT); >> + >> + if (no_wait) >> + gfp = GFP_NOIO; > > GFP_NOIO means that direct reclaim is still allowed. Not sure whether you > want to enter direct reclaim from io_uring fast path because in theory that > can still sleep. GFP_NOWAIT would be a more natural choice... I'll change it to GFP_NOWAIT in the next version of the patch series. > > Honza