lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANe_+UiH-1uJPRE2CWAiu=h=JG97aGD-QtvaaRvcAYOfCB8CuQ@mail.gmail.com>
Date:   Mon, 20 Dec 2021 12:21:40 +0000
From:   Mark Hemment <markhemm@...glemail.com>
To:     NeilBrown <neilb@...e.de>
Cc:     Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        Chuck Lever <chuck.lever@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Mel Gorman <mgorman@...e.de>,
        Christoph Hellwig <hch@...radead.org>,
        David Howells <dhowells@...hat.com>, linux-nfs@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/18] MM: submit multipage write for SWP_FS_OPS swap-space

On Thu, 16 Dec 2021 at 23:56, NeilBrown <neilb@...e.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@...e.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ