]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: submit multipage reads for SWP_FS_OPS swap-space
authorNeilBrown <neilb@suse.de>
Thu, 14 Apr 2022 06:07:03 +0000 (23:07 -0700)
committerakpm <akpm@linux-foundation.org>
Thu, 14 Apr 2022 06:07:03 +0000 (23:07 -0700)
commit84b0bc0b9c2a9335d04bb93f204a2545681cbd27
treef202c43bbc209888246962b2794d862aa1bbd4f4
parent1f82305a9b51b52ef8ef4a7a18ae624ed6a2ba0c
mm: submit multipage reads for SWP_FS_OPS swap-space

swap_readpage() is given one page at a time, but may be called repeatedly
in succession.

For block-device swap-space, the blk_plug functionality allows the
multiple pages to be combined together at lower layers.  That cannot be
used for SWP_FS_OPS as blk_plug may not exist - it is only active when
CONFIG_BLOCK=y.  Consequently all swap reads over NFS are single page
reads.

With this patch we pass in a pointer-to-pointer when swap_readpage can
store state between calls - much like the effect of blk_plug.  After
calling swap_readpage() some number of times, the state will be passed to
swap_read_unplug() which can submit the combined request.

Link: https://lkml.kernel.org/r/164859778127.29473.14059420492644907783.stgit@noble.brown
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c
mm/memory.c
mm/page_io.c
mm/swap.h
mm/swap_state.c