public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 0/2] Close a hole where IOCB_NOWAIT reads could sleep
@ 2021-07-11 15:09 Matthew Wilcox (Oracle)
  2021-07-11 15:09 ` [PATCH 1/2] mm/readahead: Add gfp_flags to ractl Matthew Wilcox (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-07-11 15:09 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Matthew Wilcox (Oracle), io-uring, linux-mm, linux-fsdevel,
	linux-aio

I noticed a theoretical case where an IOCB_NOWAIT read could sleep:

filemap_get_pages
  filemap_get_read_batch
  page_cache_sync_readahead
    page_cache_sync_ra
      ondemand_readahead
        do_page_cache_ra
        page_cache_ra_unbounded
          gfp_t gfp_mask = readahead_gfp_mask(mapping);
          memalloc_nofs_save()
          __page_cache_alloc(gfp_mask);

We're in a nofs context, so we're not going to start new IO, but we might
wait for writeback to complete.  We generally don't want to sleep for IO,
particularly not for IO that isn't related to us.

Jens, can you run this through your test rig and see if it makes any
practical difference?

Matthew Wilcox (Oracle) (2):
  mm/readahead: Add gfp_flags to ractl
  mm/filemap: Prevent waiting for memory for NOWAIT reads

 include/linux/pagemap.h |  3 +++
 mm/filemap.c            | 31 +++++++++++++++++++------------
 mm/readahead.c          | 16 ++++++++--------
 3 files changed, 30 insertions(+), 20 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-24 19:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-11 15:09 [PATCH 0/2] Close a hole where IOCB_NOWAIT reads could sleep Matthew Wilcox (Oracle)
2021-07-11 15:09 ` [PATCH 1/2] mm/readahead: Add gfp_flags to ractl Matthew Wilcox (Oracle)
2021-07-12 11:34   ` Christoph Hellwig
2021-07-12 14:37     ` Matthew Wilcox
2021-07-11 15:09 ` [PATCH 2/2] mm/filemap: Prevent waiting for memory for NOWAIT reads Matthew Wilcox (Oracle)
2021-07-12  1:44 ` [PATCH 0/2] Close a hole where IOCB_NOWAIT reads could sleep Jens Axboe
2021-07-24 18:22   ` Matthew Wilcox
2021-07-24 19:46     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox