lkml.org 
[lkml]   [2021]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 07/18] MM: submit multipage write for SWP_FS_OPS swap-space
On Thu, 16 Dec 2021 at 23:56, NeilBrown <neilb@suse.de> wrote:
>
> swap_writepage() is given one page at a time, but may be called repeatedly
> in succession.
> For block-device swapspace, 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 a pointer-to-pointer via the wbc.
> swap_writepage can store state between calls - much like the pointer
> passed explicitly to swap_readpage. After calling swap_writepage() some
> number of times, the state will be passed to swap_write_unplug() which
> can submit the combined request.
>
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
> include/linux/writeback.h | 7 +++
> mm/page_io.c | 98 ++++++++++++++++++++++++++++++---------------
> mm/swap.h | 1
> mm/vmscan.c | 9 +++-
> 4 files changed, 80 insertions(+), 35 deletions(-)
...
> +void swap_write_unplug(struct swap_iocb *sio)
> +{
> + struct iov_iter from;
> + struct address_space *mapping = sio->iocb.ki_filp->f_mapping;
> + int ret;
> +
> + iov_iter_bvec(&from, WRITE, sio->bvec, sio->pages,
> + PAGE_SIZE * sio->pages);
> + ret = mapping->a_ops->swap_rw(&sio->iocb, &from);
> + if (ret != -EIOCBQUEUED)
> + sio_write_complete(&sio->iocb, ret);
> +}
> +

As swap_write_unplug() is called from vmscan.c, need an 'no-op'
version (in "swap.h") for when !CONFIG_SWAP

Mark

\
 
 \ /
  Last update: 2021-12-20 13:22    [W:0.212 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site