From: jingxiang zeng <jingxiangzeng.cas@gmail.com>
To: Zhongkun He <hezhongkun.hzk@bytedance.com>
Cc: "Michal Koutný" <mkoutny@suse.com>,
"Shakeel Butt" <shakeel.butt@linux.dev>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Jingxiang Zeng" <linuszeng@tencent.com>,
akpm@linux-foundation.org, linux-mm@kvack.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
mhocko@kernel.org, muchun.song@linux.dev, kasong@tencent.com
Subject: Re: [External] Re: [RFC 2/5] memcontrol: add boot option to enable memsw account on dfl
Date: Thu, 3 Apr 2025 17:16:45 +0800 [thread overview]
Message-ID: <CAJqJ8ihLfcDROuCjMfoNzOtRRZhVDWEx04ik6cS9NO6hVua0xA@mail.gmail.com> (raw)
In-Reply-To: <CACSyD1NisD-ZggRz0BaxUdJ9so4j-sKPZi361HJAum3+bHO+tQ@mail.gmail.com>
On Thu, 3 Apr 2025 at 15:47, Zhongkun He <hezhongkun.hzk@bytedance.com> wrote:
>
> On Wed, Apr 2, 2025 at 9:42 PM Michal Koutný <mkoutny@suse.com> wrote:
> >
> > On Thu, Mar 20, 2025 at 08:33:09AM -0700, Shakeel Butt <shakeel.butt@linux.dev> wrote:
> > > However I want us to discuss and decide the semantics of
> > > memsw from scratch rather than adopting v1 semantics.
> >
> > +1
> >
> > > Also we should discuss how memsw and swap limits would interact and
> > > what would be the appropriate default.
> >
> > Besides more complicated implementation, merged memsw won't represent an
> > actual resource.
> >
> > So I'd be interested in use cases (other than "used to it from v1") that
> > cannot be controlled with separate memory. and swap. limits.
> >
>
> Hi Michal
>
> We encountered an issue, which is also a real use case. With memory offloading,
> we can move some cold pages to swap. Suppose an application’s peak memory
> usage at certain times is 10GB, while at other times, it exists in a
> combination of
> memory and swap. If we set limits on memory or swap separately, it would lack
> flexibility—sometimes it needs 1GB memory + 9GB swap, sometimes 5GB
> memory + 5GB swap, or even 10GB memory + 0GB swap. Therefore, we strongly
> hope to use the mem+swap charging method in cgroupv2
>
> >
> > 0.02€,
> > Michal
Yes, in the container scenario, if swap is enabled on the server and
the customer's
container requires 10GB of memory, we only need to set
memory.memsw.limit_in_bytes=10GB, and the kernel can automatically swap out
part of the business container's memory to swap according to the server's memory
pressure, and it can be fully guaranteed that the customer's container
will not use
more memory because swap is enabled on the server.
>
next prev parent reply other threads:[~2025-04-03 9:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 6:41 [RFC 0/5] add option to restore swap account to cgroupv1 mode Jingxiang Zeng
2025-03-19 6:41 ` [RFC 1/5] Kconfig: add SWAP_CHARGE_V1_MODE config Jingxiang Zeng
2025-03-19 19:29 ` Shakeel Butt
2025-03-19 19:31 ` Shakeel Butt
2025-03-19 6:41 ` [RFC 2/5] memcontrol: add boot option to enable memsw account on dfl Jingxiang Zeng
2025-03-19 19:34 ` Shakeel Butt
2025-03-19 22:30 ` Roman Gushchin
2025-03-20 8:43 ` jingxiang zeng
2025-03-20 14:28 ` Johannes Weiner
2025-03-20 15:16 ` Roman Gushchin
2025-03-20 15:33 ` Shakeel Butt
2025-04-02 13:40 ` Michal Koutný
2025-04-03 7:47 ` [External] " Zhongkun He
2025-04-03 9:16 ` jingxiang zeng [this message]
2025-04-11 16:57 ` Michal Koutný
2025-04-16 8:29 ` jingxiang zeng
2025-05-05 18:29 ` Michal Koutný
2025-03-20 8:51 ` jingxiang zeng
2025-03-19 6:41 ` [RFC 3/5] mm/memcontrol: do not scan anon pages if memsw limit is hit Jingxiang Zeng
2025-03-19 19:36 ` Shakeel Butt
2025-03-20 8:40 ` jingxiang zeng
2025-03-19 6:41 ` [RFC 4/5] mm/memcontrol: allow memsw account in cgroup v2 Jingxiang Zeng
2025-03-19 6:41 ` [RFC 5/5] Docs/cgroup-v2: add cgroup.memsw_account_on_dfl Documentation Jingxiang Zeng
2025-03-19 19:27 ` [RFC 0/5] add option to restore swap account to cgroupv1 mode Shakeel Butt
2025-03-19 19:38 ` Johannes Weiner
2025-03-19 19:51 ` Shakeel Butt
2025-03-20 8:09 ` jingxiang zeng
2025-03-20 15:08 ` 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=CAJqJ8ihLfcDROuCjMfoNzOtRRZhVDWEx04ik6cS9NO6hVua0xA@mail.gmail.com \
--to=jingxiangzeng.cas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hezhongkun.hzk@bytedance.com \
--cc=kasong@tencent.com \
--cc=linuszeng@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
/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