[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250922173158997VPIUgFcs8UoazWb_JQIc9@zte.com.cn>
Date: Mon, 22 Sep 2025 17:31:58 +0800 (CST)
From: <xu.xin16@....com.cn>
To: <mhocko@...e.com>
Cc: <akpm@...ux-foundation.org>, <shakeel.butt@...ux.dev>,
<hannes@...xchg.org>, <roman.gushchin@...ux.dev>, <david@...hat.com>,
<chengming.zhou@...ux.dev>, <muchun.song@...ux.dev>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<cgroups@...r.kernel.org>
Subject: 答复: [PATCH linux-next v3 0/6] memcg: Support per-memcg KSM metrics
> > From: xu xin <xu.xin16@....com.cn>
> >
> > v2->v3:
> > ------
> > Some fixes of compilation error due to missed inclusion of header or missed
> > function definition on some kernel config.
> > https://lore.kernel.org/all/202509142147.WQI0impC-lkp@intel.com/
> > https://lore.kernel.org/all/202509142046.QatEaTQV-lkp@intel.com/
> >
> > v1->v2:
> > ------
> > According to Shakeel's suggestion, expose these metric item into memory.stat
> > instead of a new interface.
> > https://lore.kernel.org/all/ir2s6sqi6hrbz7ghmfngbif6fbgmswhqdljlntesurfl2xvmmv@yp3w2lqyipb5/
> >
> > Background
> > ==========
> >
> > With the enablement of container-level KSM (e.g., via prctl [1]), there is
> > a growing demand for container-level observability of KSM behavior. However,
> > current cgroup implementations lack support for exposing KSM-related metrics.
>
> Could you be more specific why this is needed and what it will be used
> for?
Yes. Some Linux application developers or vendors are eager to deploy container-level
KSM feature in containers (docker, containerd or runc and so on). They have found
significant memory savings without needing to modify application source code as
before—for example, by adding prctl to enable KSM in the container’s startup
program. Processes within the container can inherit KSM attributes via fork,
allowing the entire container to have KSM enabled.
However, in practice, not all containers benefit from KSM’s memory savings. Some
containers may have few identical pages but incur additional memory overhead due
to excessive ksm_rmap_items generation from KSM scanning. Therefore, we need to
provide a container-level KSM monitoring method, enabling users to adjust their
strategies based on actual KSM merging performance.
> --
> Michal Hocko
> SUSE Labs
Powered by blists - more mailing lists