From: YoungJun Park <youngjun.park@lge.com>
To: Jianyue Wu <wujianyue000@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>, Chris Li <chrisl@kernel.org>,
Baoquan He <bhe@redhat.com>, Nhat Pham <nphamcs@gmail.com>,
Barry Song <baohua@kernel.org>, Kairui Song <kasong@tencent.com>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jens Axboe <axboe@kernel.dk>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Jan Kara <jack@suse.cz>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/page_io: let block drivers register custom swap I/O ops
Date: Mon, 15 Jun 2026 10:50:38 +0900 [thread overview]
Message-ID: <ai9abo7GwMl+g43G@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <20260614-zram-swap-ops-block-register-v1-1-6c1a6639c222@gmail.com>
On Sun, Jun 14, 2026 at 11:35:29PM +0800, Jianyue Wu wrote:
...
Hello Jianyue.
Currently, the patch commit log indicates only a single custom swap
registration is supported. Shouldn't we allow multiple block drivers to
register their custom ops simultaneously from the beginning?
> int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
> struct list_head *folio_list);
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 284eebc40a70..ebdc96092961 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -2849,6 +2849,10 @@ static int setup_swap_extents(struct swap_info_struct *sis,
> sis->ops = &swap_bdev_ops;
>
> if (S_ISBLK(inode->i_mode)) {
> + const struct swap_ops *block_ops = lookup_swap_block_ops(sis);
Also, just a personal thought on this part.
Instead of using `block_device_fops` as a lookup key, what if we handle
this similarly to how filesystems use the `a_ops->swap_activate` callback?
We could add a `swap_activate` callback directly into
struct block_device_operations (zram's zram_devops). This way, the
block device itself can set up and replace the swap `ops` directly without
needing a separate registration/lookup mechanism.
What are your thoughts on this approach?
Thanks,
Youngjun Park
next prev parent reply other threads:[~2026-06-15 1:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-14 15:35 [PATCH 0/3] mm/zram: route block swap I/O through swap_ops Jianyue Wu
2026-06-14 15:35 ` [PATCH 1/3] mm/page_io: let block drivers register custom swap I/O ops Jianyue Wu
2026-06-15 1:50 ` YoungJun Park [this message]
2026-06-15 12:49 ` Jianyue Wu
2026-06-14 15:35 ` [PATCH 2/3] mm/zram: handle swap read/write via swap_ops Jianyue Wu
2026-06-15 6:39 ` YoungJun Park
2026-06-15 13:19 ` Jianyue Wu
2026-06-14 15:35 ` [PATCH 3/3] mm/swap: route slot free notifications through swap_ops Jianyue Wu
2026-06-15 9:14 ` [PATCH 0/3] mm/zram: route block swap I/O " Barry Song
2026-06-15 13:34 ` Jianyue Wu
2026-06-16 12:36 ` Christoph Hellwig
2026-06-17 3:38 ` Jianyue Wu
2026-06-17 3:46 ` Sergey Senozhatsky
2026-06-17 5:44 ` Jianyue Wu
2026-06-17 6:10 ` Sergey Senozhatsky
2026-06-17 6:19 ` Christoph Hellwig
2026-06-17 6:17 ` Christoph Hellwig
2026-06-17 14:01 ` Jianyue Wu
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=ai9abo7GwMl+g43G@yjaykim-PowerEdge-T330 \
--to=youngjun.park@lge.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chrisl@kernel.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=kasong@tencent.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=senozhatsky@chromium.org \
--cc=shikemeng@huaweicloud.com \
--cc=willy@infradead.org \
--cc=wujianyue000@gmail.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
all inboxes | Powered by JetHome®