From: Baoquan He <baoquan.he@linux.dev>
To: linux-mm@kvack.org
Cc: akpm@linux-foundation.org, david@kernel.org, chrisl@kernel.org,
kasong@tencent.com, nphamcs@gmail.com, baohua@kernel.org,
youngjun.park@lge.com, corbet@lwn.net, hannes@cmpxchg.org,
chengming.zhou@linux.dev, kunwu.chan@gmail.com,
klarasmodin@gmail.com, linux-kernel@vger.kernel.org,
Baoquan He <hebaoquan@kylinos.cn>
Subject: Re: [PATCH v5 00/19] mm, swap: extendable swap devices (xswap phase I)
Date: Mon, 9 Nov 2026 14:15:38 +0800 [thread overview]
Message-ID: <avFlClZec9mNayjd@fedora> (raw)
In-Reply-To: <20261109055455.536925-1-baoquan.he@linux.dev>
On 11/09/26 at 01:54pm, Baoquan He wrote:
Forgot adding change history versions before v4, please refer to below
v4 patchset cover letter if you want to check.
[PATCH v4 00/14] mm, swap: extendable swap devices (xswap phase I)
https://lore.kernel.org/all/20261003003136.750633-1-hebaoquan@kylinos.cn/T/#u
> Changelog
> =========
> v4 -> v5:
> - Rebased onto the latest mm-new (2c5dafa7f289).
>
> - A device now has a stable id instead of exposing the swap type:
> /proc/swaps shows xswap<id>, the debugfs file is named by the id and
> prints the type as well, and destroy takes the id. The id is assigned
> per boot and never reused, so a value read earlier cannot name a
> different device.
>
> - swapoff accepts the name: swapoff xswap<id> and swapoff -a tear the
> device down, while a real file or directory keeps precedence. A name
> that does not exist reports -ENOENT; the sysfs destroy keeps -ENODEV
> for an id it does not know. The interfaces are now documented in
> Documentation/ABI/testing/sysfs-kernel-mm-xswap and zswap.rst.
>
> - CONFIG_XSWAP_DEFAULT_MAX sets the default size of a new device. It
> takes a percentage of RAM, a size, or "max", and defaults to "200%";
> xswap.max= still overrides it.
>
> - The cluster_info accesses are RCU-safe: the allocation fast path bounds
> a cached cluster against the mapped range, and the shrink drains the
> per-cpu cache and waits an RCU grace period before unmapping.
>
> - xswap_grow() now links the clusters it mapped even when swapoff has
> already cleared SWP_WRITEOK, so a failed swapoff cannot leave them
> mapped and on no list.
>
> - swap_info_remove() skips the commit limit probe for xswap; real swap
> devices keep it. See the overcommit note above.
>
> - The cgroup zswap gate is checked again after the allocation when an
> xswap device appeared after the initial lookup, so a slot is not kept
> for a cgroup that cannot zswap.
>
> - The patches are reorganized: the VM_SPARSE work is split into helpers
> and the xswap use, the max/pages widening moves before the sysfs
> interface, the shrink trigger now carries the workqueue deferral, and
> the unmap helper is prepared for range shrinking in its own patch. The
> series is now phase I of four, with the swap-table backend records as
> a phase of their own.
>
> Baoquan He (18):
> mm, swap: refactor free_swap_cluster_info to take swap_info_struct
> mm, swap: add VM_SPARSE cluster-array helpers for xswap
> mm, swap: use a VM_SPARSE cluster array for xswap devices
> mm, swap: widen swap_info_struct max/pages to unsigned long
> mm, swap: add a sysfs interface to create xswap devices
> mm, swap: refactor swapoff and add xswap_destroy
> mm, swap: require zswap for xswap devices
> mm, swap: use a stable id for xswap devices
> mm, swap: let the command line set the xswap device size
> mm, swap: add CONFIG_XSWAP_DEFAULT_MAX
> mm, swap: let swapoff destroy xswap devices by name
> mm, swap: add xswap grow trigger on cluster allocation
> mm, swap: add debugfs counters for xswap
> mm, swap: make xswap cluster_info accesses RCU-safe
> mm, swap: prepare xswap_unmap_clusters for range shrinking
> mm, swap: add xswap shrink trigger and defer it to a workqueue
> mm, swap: do not give an xswap slot to a cgroup that cannot zswap
> mm, swap: skip the overcommit probe when removing xswap
>
> Chris Li (1):
> mm: xswap support for zswap
>
> .../ABI/testing/sysfs-kernel-mm-xswap | 43 +
> .../admin-guide/kernel-parameters.txt | 8 +
> Documentation/admin-guide/mm/zswap.rst | 9 +
> MAINTAINERS | 1 +
> include/linux/swap.h | 17 +-
> mm/Kconfig | 20 +
> mm/page_io.c | 19 +
> mm/swap_state.c | 9 +
> mm/swapfile.c | 1569 +++++++++++++++--
> mm/zswap.c | 11 +-
> 10 files changed, 1593 insertions(+), 113 deletions(-)
> create mode 100644 Documentation/ABI/testing/sysfs-kernel-mm-xswap
>
>
> base-commit: 2c5dafa7f289d760f4492260b0988029aab478b0
> --
> 2.54.0
>
>
prev parent reply other threads:[~2026-11-09 6:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 5:54 Baoquan He
2026-11-09 5:54 ` [PATCH v5 01/19] mm: xswap support for zswap Baoquan He
2026-11-09 5:54 ` [PATCH v5 02/19] mm, swap: refactor free_swap_cluster_info to take swap_info_struct Baoquan He
2026-11-09 5:54 ` [PATCH v5 03/19] mm, swap: add VM_SPARSE cluster-array helpers for xswap Baoquan He
2026-11-09 5:54 ` [PATCH v5 04/19] mm, swap: use a VM_SPARSE cluster array for xswap devices Baoquan He
2026-11-09 5:54 ` [PATCH v5 05/19] mm, swap: widen swap_info_struct max/pages to unsigned long Baoquan He
2026-11-09 5:54 ` [PATCH v5 06/19] mm, swap: add a sysfs interface to create xswap devices Baoquan He
2026-11-09 5:54 ` [PATCH v5 07/19] mm, swap: refactor swapoff and add xswap_destroy Baoquan He
2026-11-09 5:54 ` [PATCH v5 08/19] mm, swap: require zswap for xswap devices Baoquan He
2026-11-09 5:54 ` [PATCH v5 09/19] mm, swap: use a stable id " Baoquan He
2026-11-09 5:54 ` [PATCH v5 10/19] mm, swap: let the command line set the xswap device size Baoquan He
2026-11-09 5:54 ` [PATCH v5 11/19] mm, swap: add CONFIG_XSWAP_DEFAULT_MAX Baoquan He
2026-11-09 5:54 ` [PATCH v5 12/19] mm, swap: let swapoff destroy xswap devices by name Baoquan He
2026-11-09 5:54 ` [PATCH v5 13/19] mm, swap: add xswap grow trigger on cluster allocation Baoquan He
2026-11-09 5:54 ` [PATCH v5 14/19] mm, swap: add debugfs counters for xswap Baoquan He
2026-11-09 5:54 ` [PATCH v5 15/19] mm, swap: make xswap cluster_info accesses RCU-safe Baoquan He
2026-11-09 5:54 ` [PATCH v5 16/19] mm, swap: prepare xswap_unmap_clusters for range shrinking Baoquan He
2026-11-09 5:54 ` [PATCH v5 17/19] mm, swap: add xswap shrink trigger and defer it to a workqueue Baoquan He
2026-11-09 5:54 ` [PATCH v5 18/19] mm, swap: do not give an xswap slot to a cgroup that cannot zswap Baoquan He
2026-11-09 5:54 ` [PATCH v5 19/19] mm, swap: skip the overcommit probe when removing xswap Baoquan He
2026-11-09 6:15 ` Baoquan He [this message]
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=avFlClZec9mNayjd@fedora \
--to=baoquan.he@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hebaoquan@kylinos.cn \
--cc=kasong@tencent.com \
--cc=klarasmodin@gmail.com \
--cc=kunwu.chan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--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
all inboxes | Powered by JetHome®