Skip to content

NFS/localio: various improvements

Mike Snitzer linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4NFS/localio: prevent direct reclaim recursion into NFS via nfs_writepagesfs/nfs/localio.c+15 -00 replies
2/4NFS/localio: use GFP_NOIO and non-memreclaim workqueue in nfs_local_commitfs/nfs/localio.c+8 -30 replies
3/4NFS/localio: remove -EAGAIN handling in nfs_local_doio()fs/nfs/localio.c+0 -20 replies
4/4NFS/localio: switch nfs_local_do_read and nfs_local_do_write to return voidfs/nfs/localio.c+13 -190 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchAllen Lu
1/4T-b
2/4
3/4
4/4

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/4] NFS/localio: various improvements

Hi,

This series has been rebased on Trond's recent patchset:
https://lore.kernel.org/linux-nfs/[email protected]/

but the first 2 patches were developed while chasing a particularly nasty deadlock that was reproducible when putting LOCALIO under heavy load on systems with smaller amounts of memory (16G). Ultimately that deadlock happens to also be fixed by Trond's recent commit here:
https://git.linux-nfs.org/?p=trondmy/linux-nfs.git;a=commitdiff;h=cce0be6eb4971456b703aaeafd571650d314bcca

FYI, prior to that nfs_release_folio() deadlock fix, tasks would be stuck like:

[92] "khugepaged"

[<0>] wait_on_commit+0x71/0xb0 [nfs]
[<0>] __nfs_commit_inode+0x131/0x180 [nfs]
[<0>] nfs_wb_folio+0xa7/0x1b0 [nfs]
[<0>] nfs_release_folio+0x6b/0x120 [nfs]
[<0>] split_huge_page_to_list_to_order+0x367/0x840
[<0>] migrate_pages_batch+0x208/0x7b0
[<0>] migrate_pages+0x220/0x550
[<0>] compact_zone+0x300/0x6e0
[<0>] compact_zone_order+0xc7/0x110
[<0>] try_to_compact_pages+0xe6/0x2d0
[<0>] __alloc_pages_direct_compact+0x8a/0x210
[<0>] __alloc_pages_slowpath.constprop.0+0x218/0x9c0
[<0>] __alloc_pages_noprof+0x335/0x350
[<0>] __folio_alloc_noprof+0x14/0x30
[<0>] alloc_charge_folio+0xdd/0x1b0
[<0>] collapse_huge_page+0x63/0x700
[<0>] hpage_collapse_scan_pmd+0x627/0x750
[<0>] khugepaged_scan_mm_slot.constprop.0+0x3cf/0x5a0
[<0>] khugepaged+0x105/0x200
[<0>] kthread+0xef/0x230
[<0>] ret_from_fork+0x31/0x50
[<0>] ret_from_fork_asm+0x1a/0x30

and:

[12813] "nfsd"

[<0>] wait_on_commit+0x71/0xb0 [nfs]
[<0>] __nfs_commit_inode+0x131/0x180 [nfs]
[<0>] nfs_wb_folio+0xa7/0x1b0 [nfs]
[<0>] nfs_release_folio+0x6b/0x120 [nfs]
[<0>] split_huge_page_to_list_to_order+0x367/0x840
[<0>] migrate_pages_batch+0x208/0x7b0
[<0>] migrate_pages+0x220/0x550
[<0>] compact_zone+0x300/0x6e0
[<0>] compact_zone_order+0xc7/0x110
[<0>] try_to_compact_pages+0xe6/0x2d0
[<0>] __alloc_pages_direct_compact+0x8a/0x210
[<0>] __alloc_pages_slowpath.constprop.0+0x218/0x9c0
[<0>] __alloc_pages_noprof+0x335/0x350
[<0>] alloc_pages_mpol_noprof+0x8f/0x1f0
[<0>] folio_alloc_noprof+0x5b/0xb0
[<0>] __filemap_get_folio+0x177/0x330
[<0>] nfs_write_begin+0x81/0x370 [nfs]
[<0>] generic_perform_write+0x91/0x290
[<0>] nfs_file_write+0x1ea/0x2f0 [nfs]
[<0>] vfs_iocb_iter_write+0xc0/0x210
[<0>] nfsd_vfs_write+0x26e/0x760 [nfsd]
[<0>] nfsd_write+0x17c/0x1c0 [nfsd]
[<0>] nfsd3_proc_write+0x10b/0x1a0 [nfsd]
[<0>] nfsd_dispatch+0xea/0x220 [nfsd]
[<0>] svc_process_common+0x4cd/0x6c0 [sunrpc]
[<0>] svc_process+0x145/0x210 [sunrpc]
[<0>] svc_handle_xprt+0x481/0x550 [sunrpc]
[<0>] svc_recv+0x170/0x2c0 [sunrpc]
[<0>] nfsd+0x8f/0xf0 [nfsd]
[<0>] kthread+0xef/0x230
[<0>] ret_from_fork+0x31/0x50
[<0>] ret_from_fork_asm+0x1a/0x30

Anyway, I think this LOCALIO series is worthwhile on its own and ready for wider review and hopeful inclusion.

Thanks,
Mike

Mike Snitzer (4):
NFS/localio: prevent direct reclaim recursion into NFS via nfs_writepages NFS/localio: use GFP_NOIO and non-memreclaim workqueue in nfs_local_commit NFS/localio: remove -EAGAIN handling in nfs_local_doio() NFS/localio: switch nfs_local_do_read and nfs_local_do_write to return void

 fs/nfs/localio.c | 60 +++++++++++++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 24 deletions(-)
Signature · 1 line
2.44.0