Re: [PATCH v2 0/9] support ksm_stat showing at cgroup level

From: Andrew Morton
Date: Thu May 01 2025 - 16:27:34 EST


On Thu, 1 May 2025 12:08:54 +0800 (CST) <xu.xin16@xxxxxxxxxx> wrote:

> 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.
>
> This patch introduces a new interface named ksm_stat
> at the cgroup hierarchy level, enabling users to monitor KSM merging
> statistics specifically for containers where this feature has been
> activated, eliminating the need to manually inspect KSM information for
> each individual process within the cgroup.

Well, you didn't cc any of the memcg maintainers!

The feature seems desirable and the implementation straightforward.
I'll add the patchset into mm.git for some testing, pending review
outcomes, thanks.