From: Usama Arif <usama.arif@linux.dev>
To: Christoph Hellwig <hch@lst.de>
Cc: Usama Arif <usama.arif@linux.dev>,
baoquan.he@linux.dev, akpm@linux-foundation.org,
chrisl@kernel.org, kasong@tencent.com, nphamcs@gmail.com,
shikemeng@huaweicloud.com, youngjun.park@lge.com,
ryncsn@gmail.com, trondmy@kernel.org, anna@kernel.org,
sfrench@samba.org, linux-mm@kvack.org,
linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/swap: revert to single-folio writes for synchronous swap devices
Date: Wed, 22 Jul 2026 09:36:00 -0700 [thread overview]
Message-ID: <20260722163601.1421253-1-usama.arif@linux.dev> (raw)
In-Reply-To: <20260722130615.3163560-2-hch@lst.de>
On Wed, 22 Jul 2026 15:06:07 +0200 Christoph Hellwig <hch@lst.de> wrote:
> Kairui Song reported that zram benefits from submitting each folio
> directly instead of batching up I/O because the classic LRU scanning
> benefits from clearing the folio writeback bit in the scan loop.
>
> Accommodate that by kicking off reads for synchronous devices for
s/reads/writes/ ?
> each iteration.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> mm/page_io.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
Change makes sense.
After the commit message fix above, feel free to add
Acked-by: Usama Arif <usama.arif@linux.dev>
> diff --git a/mm/page_io.c b/mm/page_io.c
> index e4fa7ffffe8b..c984a4023a65 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -358,7 +358,16 @@ static void swap_add_folio(struct swap_io_ctx *ctx, struct folio *folio, int rw)
> }
> bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0);
> sio->len += folio_size(folio);
> - if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) {
> +
> + /*
> + * Write out the iocb if we filled it, or if the device is synchronous.
> + *
> + * The latter is to work around expectations in the classic LRU code
> + * which make synchronous clearing of the folio writeback flag in the
> + * reclaim path beneficial.
> + */
> + if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs) ||
> + (rw == WRITE && (sis->flags & SWP_SYNCHRONOUS_IO))) {
> if (rw == WRITE)
> swap_write_submit(ctx);
> else
> --
> 2.53.0
>
>
next prev parent reply other threads:[~2026-07-22 16:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 13:06 swap_ops updates Christoph Hellwig
2026-07-22 13:06 ` [PATCH 1/3] mm/swap: revert to single-folio writes for synchronous swap devices Christoph Hellwig
2026-07-22 16:36 ` Usama Arif [this message]
2026-07-22 16:57 ` Chris Li
2026-07-22 13:06 ` [PATCH 2/3] mm/swap: add a new swap_ops.h header to allow for pluggable swap ops Christoph Hellwig
2026-07-22 16:32 ` Usama Arif
2026-07-22 16:56 ` Chris Li
2026-07-22 13:06 ` [PATCH 3/3] mm/swap: move swap_ops into file systems for file system-based swap Christoph Hellwig
2026-07-22 17:07 ` Chris Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260722163601.1421253-1-usama.arif@linux.dev \
--to=usama.arif@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=anna@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chrisl@kernel.org \
--cc=hch@lst.de \
--cc=kasong@tencent.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=ryncsn@gmail.com \
--cc=sfrench@samba.org \
--cc=shikemeng@huaweicloud.com \
--cc=trondmy@kernel.org \
--cc=youngjun.park@lge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox