From: YoungJun Park <youngjun.park@lge.com>
To: Chris Li <chrisl@kernel.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Kairui Song <kasong@tencent.com>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Nhat Pham <nphamcs@gmail.com>, Baoquan He <bhe@redhat.com>,
Barry Song <baohua@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
gunho.lee@lge.com, taejoon.song@lge.com, austin.kim@lge.com,
hyungjun.cho@lge.com
Subject: Re: [RFC PATCH v2 0/5] mm/swap, memcg: Introduce swap tiers for cgroup based swap control
Date: Wed, 18 Mar 2026 11:46:03 +0900 [thread overview]
Message-ID: <aboR60vcbS3edAbZ@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <CACePvbXhk2GFTay3OrPoqFU=hRt9N5fgx=FrWFQ6nj4Nyn7b8A@mail.gmail.com>
> Sorry for the late reply, busy days.
No worries at all. Hi Chris,
> >
> > To quickly summarize the main points:
> > (I might wrongly undestand your intentaion, then correct me please :) )
> >
> > * Regarding Shakeel's BPF approach, stable interface movement would be difficult,
> > so we need to choose a direction. I prefer adding it to memcg for immediate
> > usage, and if it proves highly effective, we can consider transitioning
> > entirely to BPF later.
>
> I am very concerned about locking down the kernel user interface just
> because things might change in the future. If we need to use BPF to
> get the stable user space API, I am fine with that. Completely
> blocking the new cgroup interface because of a worry about future
> change is not justifiable IMHO. There ought to be some intermediate
> staging we can do e.g. debugfs interface to test and play with the new
> API. We should focus on designing the interface as well as possible
> right now.
I completely agree with using the cgroup interface. We have clear use cases
and have already shared many thoughts on this direction.
> > * Shakeel seemed somewhat positive about matching all child tiers from the
> > parent if tiers are applied to a specific cgroup use case, and I would like
> > to start the discussion from here. Chris, I would appreciate your thoughts
> > on whether you agree with this direction of unifying all swap tiers within
> > the hierarchy as a first step.
>
> Does that mean all children will only use the parent cgroup setting?
> Wouldn't that be more restrictive and counteract the goal of making
> the API more future-proof?
> For the record, the current Google deployment can uses a different
> swap device for the child cgroup, in the current delpyment.
> The typical setup is that the top-level cgroup is a job running on a
> VM. Then there is a second cgroup level for the VMM guest memory
> allocation; swap device selection occurs at this second level.
> There is also zswap vs SSD, the SSD is something new starting the
> deployment. So it's not just about enabling zswap or not. We also need
> to select the swap device.
> If you get the current cgroup, it will need to walk the parent cgroup
> chain to find the toplevel cgroup any way. I just think having the
> hierarchy makes more sense.
Since you confirmed the use case for allowing child cgroups to have different
swap devices from their parents, I would like to keep the current hierarchical
design. It seems Shakeel was hesitant mainly due to the lack of a known use
case for this. If Shakeel has further questions, I would appreciate it if you
could help explain the Google deployment use case.
> We need to find customers willing to use this promotion/demotion. I
> hesitate to build something while hoping to find someone to use it
> later.
> It would be good to identify someone who can immediately use and test
> this promotion/demotion feature.
> We should focus the discussion on achieving a more flexible swap
> device selection approach and reach a conclusion on the API discussion
> before discussing promotion/demotion. If we can't even have a usable
> swap tier interface, there is nothing to promote.
>
Since I have already sent RFCv3, Patch v4
(https://lore.kernel.org/linux-mm/20260217000950.4015880-1-youngjun.park@lge.com/)_
and we seem aligned on the core direction,
I will proceed with sending v5 based on the current design.
@Shakeel: I have been waiting for your feedback longtime, but I will move forward with
v5 for now. Since Chris confirmed a solid use case for the child-parent
hierarchy, please let us know if you have any remaining concerns when I post
the v5 patch.
As a brief history, we have evolved this proposal from per-cgroup priority to
swap tiers, presented it at LPC, and are actually using it in our production
environment. I sincerely hope we can get this merged into mainline.
and evolve this mechanism after applying it.
Thanks,
Youngjun Park
next prev parent reply other threads:[~2026-03-18 2:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 6:52 [RFC PATCH v2 0/5] mm/swap, memcg: Introduce swap tiers for cgroup based swap control Youngjun Park
2026-01-26 6:52 ` [RFC PATCH v2 v2 1/5] mm: swap: introduce swap tier infrastructure Youngjun Park
2026-02-12 9:07 ` Chris Li
2026-02-13 2:18 ` YoungJun Park
2026-02-13 14:33 ` YoungJun Park
2026-01-26 6:52 ` [RFC PATCH v2 v2 2/5] mm: swap: associate swap devices with tiers Youngjun Park
2026-01-26 6:52 ` [RFC PATCH v2 v2 3/5] mm: memcontrol: add interface for swap tier selection Youngjun Park
2026-01-26 6:52 ` [RFC PATCH v2 v2 4/5] mm, swap: change back to use each swap device's percpu cluster Youngjun Park
2026-02-12 7:37 ` Chris Li
2026-01-26 6:52 ` [RFC PATCH v2 v2 5/5] mm, swap: introduce percpu swap device cache to avoid fragmentation Youngjun Park
2026-02-12 6:12 ` [RFC PATCH v2 0/5] mm/swap, memcg: Introduce swap tiers for cgroup based swap control Chris Li
2026-02-12 9:22 ` Chris Li
2026-02-13 2:26 ` YoungJun Park
2026-02-13 1:59 ` YoungJun Park
2026-02-12 17:57 ` Nhat Pham
2026-02-12 17:58 ` Nhat Pham
2026-02-13 2:43 ` YoungJun Park
2026-02-12 18:33 ` Shakeel Butt
2026-02-13 3:58 ` YoungJun Park
2026-02-21 3:47 ` Shakeel Butt
2026-02-21 6:07 ` Chris Li
2026-02-21 17:44 ` Shakeel Butt
2026-02-22 1:16 ` YoungJun Park
2026-03-02 21:27 ` Shakeel Butt
2026-03-04 7:27 ` YoungJun Park
2026-03-18 3:54 ` Shakeel Butt
2026-03-18 4:57 ` YoungJun Park
2026-03-10 2:14 ` YoungJun Park
2026-03-14 17:32 ` Chris Li
2026-03-18 2:46 ` YoungJun Park [this message]
2026-02-21 14:30 ` YoungJun Park
2026-02-23 5:56 ` Shakeel Butt
2026-02-27 2:43 ` YoungJun Park
2026-03-02 14:50 ` YoungJun Park
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=aboR60vcbS3edAbZ@yjaykim-PowerEdge-T330 \
--to=youngjun.park@lge.com \
--cc=akpm@linux-foundation.org \
--cc=austin.kim@lge.com \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chrisl@kernel.org \
--cc=gunho.lee@lge.com \
--cc=hannes@cmpxchg.org \
--cc=hyungjun.cho@lge.com \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=nphamcs@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=taejoon.song@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