Skip to content

RFC gfs2 readahead regression in v5.8-rc1

Andreas Gruenbacher cluster-devel linux-btrfs linux-erofs linux-ext4 linux-f2fs-devel linux-fsdevel linux-mm linux-xfs lkml ocfs2-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs: Add IOCB_CACHED flag for generic_file_read_iterinclude/linux/fs.h mm/filemap.c+15 -20 replies
2/2gfs2: Rework read and page fault lockingfs/gfs2/aops.c fs/gfs2/file.c+61 -271 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] gfs2 readahead regression in v5.8-rc1

Hello,

can the two patches in this set still be considered for v5.8?

Commit d4388340ae0b ("fs: convert mpage_readpages to mpage_readahead") which converts gfs2 and other filesystems to use the new ->readahead address space operation is leading to deadlocks between the inode glocks and page locks: ->readahead is called with the pages to readahead already locked. When gfs2_readahead then tries to lock the associated inode glock, another process already holding the inode glock may be trying to lock the same pages.

We could work around this in gfs by using a LM_FLAG_TRY lock in ->readahead for now. The real reason for this deadlock is that gfs2 shouldn't be taking the inode glock in ->readahead in the first place though, so I'd prefer to fix this "properly" instead. Unfortunately, this depends on a new IOCB_CACHED flag for generic_file_read_iter.

A previous version was posted in November:

https://lore.kernel.org/linux-fsdevel/20191122235324.17245-1-agruenba at redhat.com/

Thanks,
Andreas

Andreas Gruenbacher (2):
fs: Add IOCB_CACHED flag for generic_file_read_iter
gfs2: Rework read and page fault locking

 fs/gfs2/aops.c     | 27 ++------------------
 fs/gfs2/file.c     | 61 ++++++++++++++++++++++++++++++++++++++++++++--
 include/linux/fs.h |  1 +
 mm/filemap.c       | 16 ++++++++++--
 4 files changed, 76 insertions(+), 29 deletions(-)

base-commit: af42d3466bdc8f39806b26f593604fdc54140bcb

Signature · 1 line
2.26.2