[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ir2s6sqi6hrbz7ghmfngbif6fbgmswhqdljlntesurfl2xvmmv@yp3w2lqyipb5>
Date: Mon, 5 May 2025 14:30:25 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: xu.xin16@....com.cn
Cc: akpm@...ux-foundation.org, david@...hat.com,
linux-kernel@...r.kernel.org, wang.yaxin@....com.cn, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org, yang.yang29@....com.cn
Subject: Re: [PATCH v2 0/9] support ksm_stat showing at cgroup level
On Thu, May 01, 2025 at 12:08:54PM +0800, xu.xin16@....com.cn wrote:
> From: xu xin <xu.xin16@....com.cn>
>
> 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.
>
> Users can obtain the KSM information of a cgroup just by:
>
> # cat /sys/fs/cgroup/memory.ksm_stat
> ksm_rmap_items 76800
> ksm_zero_pages 0
> ksm_merging_pages 76800
> ksm_process_profit 309657600
>
> Current implementation supports both cgroup v2 and cgroup v1.
>
Before adding these stats to memcg, add global stats for them in
enum node_stat_item and then you can expose them in memcg through
memory.stat instead of a new interface.
Powered by blists - more mailing lists