From: Youngjun Park <youngjun.park@lge.com>
To: Johannes Weiner <hannes@cmpxchg.org>, h@yjaykim-poweredge-t330
Cc: akpm@linux-foundation.org, chrisl@kernel.org, linux-mm@kvack.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
kasong@tencent.com, mhocko@kernel.org, roman.gushchin@linux.dev,
shakeel.butt@linux.dev, muchun.song@linux.dev,
shikemeng@huaweicloud.com, baoquan.he@linux.dev,
baohua@kernel.org, yosry@kernel.org, joshua.hahnjy@gmail.com,
gunho.lee@lge.com, taejoon.song@lge.com, hyungjun.cho@lge.com,
baver.bae@lge.com, her0gyugyu@gmail.com
Subject: Re: [PATCH v10 0/6] mm/swap, memcg: Introduce swap tiers for cgroup based swap control
Date: Thu, 23 Jul 2026 20:39:22 +0900 [thread overview]
Message-ID: <amH9alaO97YqT8pY@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <amDCIl51NoNPL7Op@cmpxchg.org>
On Wed, Jul 22, 2026 at 09:14:10AM -0400, Johannes Weiner wrote:
Hello Johannes!
> Zswap is a first-order swap destination with writeback semantics. The
> way the discussion around zswap has been going in this thread is
> disappointing, and I don't feel comfortable adding permanent user
> interfaces on this basis.
I have given this a lot of thought. First, could you clarify exactly which
part of the discussion or consensus makes you hesitate? Understanding this
will help me re-evaluate my proposal.
To make sure we are on the same page, I would like to share my thoughts and
vision for the present and future of the tier interface semantics for your
further consideration.
The interface should provide the swap amount allocated to a tier and allow
the use of the swap device defined by that tier via swap.tiers.max.
Currently, it would only support 0 and 'max' (essentially on/off for
explicit usage). Auto-demotion is planned for the future, and specifying
exact capacity limits is still to be determined. (I have also reviewed
potential interface collisions and duplications based on Yosry's guidance.)
From this perspective, zswap currently cannot exist as a standalone tier. It
resides in RAM when allocated and borrows slots from other swap devices.
(If all tiers except zswap are turned off, it is effectively the same as
zswap being off, meaning there is no zswap-only tier.) The zswap writeback
interface essentially leaves only the zswap first tier enabled by using
other swap slots. Virtualized swap should solve this in the near future.
On the other hand, in systems without zswap (like ours), this situation does
not occur. Allocation and deallocation depend strictly on swap priority,
avoiding this contradiction. (While it might be possible to implement the
tier interface only for !CONFIG_ZSWAP first, I abandoned this idea as it
seemed unpromising.)
In my initial review, I considered creating the swap tier interface while
excluding zswap configurations, even if zswap is present. From zswap's
perspective, it acts as a first-order swap, and other tiers operate well
according to their original tier semantics. Once virtualized swap arrives, we can
open up the interface without any contradictions.
However, virtualized swap might be toggled on or off (at runtime or
compile time), we must still account for zswap without virtualized swap anyway.
There is also a possibility that the initial overall picture might seem
misaligned until zswap tiering is officially introduced. It looks like we must
care this case on the first stage.
Therefore, I decided to follow Yosry's suggestion. Since a zswap-only setup
has contradictions, we initially considered removing user visibility
as possible as we can (returning an error for unsupported interfaces).
Because the implementation is a bit tricky, we agreed on an on/off toggle
for this first baby step, accompanied by detailed documentation so users are
fully aware of what a zswap-only tier means.
As a result, I reviewed this direction and found it does not conflict with a
future zswap tier. When virtualized swap arrives, the design will align
perfectly, and we can consider making zswap a proper tier.
One thing that remains undecided, however, is zswap tiering, which is not
yet fully agreed upon by everyone and should be discussed at the next stage.
> We will not be merging a memcg swap tier interface until the swap side
> has a story for indirection and backend migration.
Regarding this point, is your position that an indirect layer (I see
this is virtualized swap) must be implemented first?
Or do you mean we need community consensus on the overall design before proceeding?
I believe our direction is set toward virtualized swap, but there are still some discussions regarding
implementation details.
I would love to hear your thoughts. In the meantime, my preference is to
proceed as discussed if we can agree on the future direction. If more
discussion and design verification are needed, I am happy to follow up and
address any concerns you might have.
However, if you feel the tier concept is premature, I would like to hear
your thoughts and others' as well on a fallback option. We could add
per-cgroup swap control in debugfs for now. If we need to scale back, we
could either keep the swap tier design internally or drop it entirely,
implementing per-swap control strictly for our specific use case. We could
then revisit this as a primary use case when swap tier discussions resume.
What do you think? I would appreciate hearing everyone's thoughts on this.
Youngjun
next prev parent reply other threads:[~2026-07-23 11:39 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 2:56 Youngjun Park
2026-07-13 2:56 ` [PATCH v10 1/6] mm: swap: introduce swap tier infrastructure Youngjun Park
2026-07-13 2:56 ` [PATCH v10 2/6] mm: swap: associate swap devices with tiers Youngjun Park
2026-07-13 14:28 ` Usama Arif
2026-07-13 15:20 ` Youngjun Park
2026-07-13 2:56 ` [PATCH v10 3/6] mm: memcontrol: add interface for swap tier selection Youngjun Park
2026-07-13 2:56 ` [PATCH v10 4/6] mm: swap: filter swap allocation by memcg tier mask Youngjun Park
2026-07-13 2:56 ` [PATCH v10 5/6] selftests/mm: add a swap tier configuration test Youngjun Park
2026-07-13 2:56 ` [PATCH v10 6/6] selftests/cgroup: add a swap tier routing test Youngjun Park
2026-07-13 15:50 ` [PATCH v10 0/6] mm/swap, memcg: Introduce swap tiers for cgroup based swap control Yosry Ahmed
2026-07-13 15:57 ` Youngjun Park
2026-07-13 16:01 ` Yosry Ahmed
2026-07-13 16:22 ` Youngjun Park
2026-07-14 20:44 ` Shakeel Butt
2026-07-14 20:52 ` Yosry Ahmed
2026-07-14 22:25 ` Shakeel Butt
2026-07-14 23:09 ` Yosry Ahmed
2026-07-15 5:57 ` Youngjun Park
2026-07-15 16:27 ` Yosry Ahmed
2026-07-15 17:30 ` Chris Li
2026-07-15 20:35 ` Shakeel Butt
2026-07-16 2:02 ` Youngjun Park
2026-07-15 17:27 ` Chris Li
2026-07-15 17:22 ` Chris Li
2026-07-18 15:11 ` Youngjun Park
2026-07-20 18:27 ` Yosry Ahmed
2026-07-22 1:11 ` Shakeel Butt
2026-07-21 18:37 ` Chris Li
2026-07-15 5:45 ` Youngjun Park
2026-07-15 16:25 ` Yosry Ahmed
2026-07-15 21:20 ` Chris Li
2026-07-13 17:02 ` Chris Li
2026-07-13 17:11 ` Yosry Ahmed
2026-07-13 18:34 ` Chris Li
2026-07-13 18:37 ` Yosry Ahmed
2026-07-13 19:38 ` Chris Li
2026-07-13 19:57 ` Yosry Ahmed
2026-07-13 21:49 ` Chris Li
2026-07-13 17:05 ` Chris Li
2026-07-22 13:14 ` Johannes Weiner
2026-07-23 11:39 ` Youngjun Park [this message]
2026-07-23 14:31 ` Johannes Weiner
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=amH9alaO97YqT8pY@yjaykim-PowerEdge-T330 \
--to=youngjun.park@lge.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=baver.bae@lge.com \
--cc=cgroups@vger.kernel.org \
--cc=chrisl@kernel.org \
--cc=gunho.lee@lge.com \
--cc=h@yjaykim-poweredge-t330 \
--cc=hannes@cmpxchg.org \
--cc=her0gyugyu@gmail.com \
--cc=hyungjun.cho@lge.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=taejoon.song@lge.com \
--cc=yosry@kernel.org \
/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®