From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Baoquan He <baoquan.he@linux.dev>
Cc: Klara Modin <klarasmodin@gmail.com>,
Baoquan He <hebaoquan@kylinos.cn>,
linux-mm@kvack.org, akpm@linux-foundation.org, chrisl@kernel.org,
kasong@tencent.com, hannes@cmpxchg.org, nphamcs@gmail.com,
baohua@kernel.org, youngjun.park@lge.com, yosry@kernel.org,
shikemeng@huaweicloud.com, chengming.zhou@linux.dev,
linux-kernel@vger.kernel.org, kunwu.chan@gmail.com
Subject: Re: [PATCH v4 00/14] mm, swap: extendable swap devices (xswap phase I)
Date: Tue, 13 Oct 2026 17:08:08 +0200 [thread overview]
Message-ID: <d6209813-d53e-428c-90a9-6404618d0804@kernel.org> (raw)
In-Reply-To: <as33VMjNRIZOG5Ua@MiWiFi-R3L-srv>
On 10/13/26 11:18, Baoquan He wrote:
> On 10/12/26 at 03:44pm, David Hildenbrand (Arm) wrote:
>> On 10/12/26 11:16, Baoquan He wrote:
>>> Hi Klara,
>>>
>>> ...snip...
>>>
>>> Thanks a lot for careful reviewing, and sorry for late reply.
>>>
>>> ...snip...
>>>
>>> Thanks for the comment.
>>>
>>> Here xswap.max= is a global boot parameter, while not a per-device or
>>> runtie knob. It sets the space space (si->max) of the xswap device
>>> at boot and can't change at runtime. So on the two places: the size is
>>> a global setting, fixed at boot; the priority is per device, it is in
>>> the create interface. They are different things.
>>>
>>> The default is 2xRAM. From our earlier discussion, this is the largest
>>> size we think is sensible, and in practice I don't think it is not
>>> reachable in reality. If a system has swapped out 70% of its memory, and
>>> even more at 100%, it is already doubtful that it can still function
>>> normally. So 2xRAM is an upper bound, not a target.
>>
>> I remember some overcommitted hypervisor setups where people swapped out
>> significantly more -- without any issues.
>>
>> For example, Windows VMs initialize all VM memory when booting up. Afterwards,
>> you might just have plenty of memory that was touched once but will not really
>> be used in any near future.
>>
>> So I would consider some crazy hypervisor scenarios as well where people
>> commonly have significant cold memory that is currently not hot (not in the
>> working set) but might possibly used in some distant future.
>
> Hi David,
>
> Thanks a lot for the valuable input. This is probably the first first-hand
> information I have heard about a production environment. And Klara
> measured about 160% of RAM in zswap on her RISC-V box, so the 2xRAM default
> is reachable in practice, not just in theory.
>
> So I see 2xRAM as a default, not as a cap. xswap.max= already overrides it.
> After your comment and Klara's numbers, I am open to a larger default, or to
> a "max" value for the address space. The real limit is still the backing:
> the zswap pool plus the block devices. The address space should no longer
> be the limiting factor.
>
> By the way, in Windows-VM case you mentioned, is there a block swap backend,
> or is it zswap alone? If it is zswap alone, the knob that matters is
> zswap.max_pool_percent, because it sets how much cold memory the pool can
> hold.
Excellent question: I don't remember all the details. There were talks about
over-committing up to 400%, and people played with both zswap and zram to
avoid/reduce IO.
I assume as a safety net people would always look for an additional swap backend
(that's what I remember, but I don't recall all the details).
--
Cheers,
David
next prev parent reply other threads:[~2026-10-13 15:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 0:31 [PATCH v4 00/14] mm, swap: extendable swap devices (xswap phase I) Baoquan He
2026-10-03 0:31 ` [PATCH v4 01/14] mm: xswap support for zswap Baoquan He
2026-10-07 4:22 ` KunWu Chan
2026-10-03 0:31 ` [PATCH v4 02/14] mm, swap: refactor free_swap_cluster_info to take swap_info_struct Baoquan He
2026-10-07 4:32 ` KunWu Chan
2026-10-03 0:31 ` [PATCH v4 03/14] mm, swap: back the cluster_info array with a sparse VM_SPARSE area Baoquan He
2026-10-03 0:31 ` [PATCH v4 04/14] mm, swap: add sysfs create interface for xswap Baoquan He
2026-10-07 6:32 ` KunWu Chan
2026-10-03 0:31 ` [PATCH v4 05/14] mm, swap: add xswap grow trigger on cluster allocation Baoquan He
2026-10-07 6:52 ` KunWu Chan
2026-10-03 0:31 ` [PATCH v4 06/14] mm, swap: add xswap_try_shrink and shrink trigger on cluster free Baoquan He
2026-10-03 0:31 ` [PATCH v4 07/14] mm, swap: free backing pages in xswap_unmap_clusters Baoquan He
2026-10-03 0:31 ` [PATCH v4 08/14] mm, swap: defer xswap shrink to workqueue to avoid lock recursion Baoquan He
2026-10-08 9:10 ` KunWu Chan
2026-10-12 7:23 ` Baoquan He
2026-10-03 0:31 ` [PATCH v4 09/14] mm, swap: refactor swapoff and add xswap_destroy Baoquan He
2026-10-03 0:31 ` [PATCH v4 10/14] mm, swap: require zswap for xswap devices Baoquan He
2026-10-03 0:31 ` [PATCH v4 11/14] mm, swap: do not give an xswap slot to a cgroup that cannot zswap Baoquan He
2026-10-03 0:31 ` [PATCH v4 12/14] mm, swap: widen swap_info_struct max/pages to unsigned long Baoquan He
2026-10-03 0:31 ` [PATCH v4 13/14] mm, swap: add debugfs counters for xswap Baoquan He
2026-10-03 0:31 ` [PATCH v4 14/14] mm, swap: let the command line set the xswap device size Baoquan He
2026-10-07 16:28 ` [PATCH v4 00/14] mm, swap: extendable swap devices (xswap phase I) Klara Modin
2026-10-12 9:16 ` Baoquan He
2026-10-12 13:44 ` David Hildenbrand (Arm)
2026-10-13 9:18 ` Baoquan He
2026-10-13 15:08 ` David Hildenbrand (Arm) [this message]
2026-10-13 16:42 ` Nhat Pham
2026-10-12 14:10 ` Klara Modin
2026-10-13 10:20 ` Baoquan He
2026-10-13 14:26 ` Klara Modin
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=d6209813-d53e-428c-90a9-6404618d0804@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@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=shikemeng@huaweicloud.com \
--cc=yosry@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