[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <047579c5-582a-46ac-8967-e9ca9a90cea7@infradead.org>
Date: Mon, 1 Jul 2024 08:01:58 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Xiu Jianfeng <xiujianfeng@...wei.com>, tj@...nel.org,
lizefan.x@...edance.com, hannes@...xchg.org, corbet@....net,
kamalesh.babulal@...cle.com, haitao.huang@...ux.intel.com
Cc: cgroups@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] cgroup/misc: Introduce misc.peak
Hi--
On 7/1/24 5:52 AM, Xiu Jianfeng wrote:
> Introduce misc.peak to record the historical maximum usage of the
> resource, as in some scenarios the value of misc.max could be
> adjusted based on the peak usage of the resource.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
> ---
> Documentation/admin-guide/cgroup-v2.rst | 9 ++++++++
> include/linux/misc_cgroup.h | 2 ++
> kernel/cgroup/misc.c | 29 +++++++++++++++++++++++++
> 3 files changed, 40 insertions(+)
>
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index ae0fdb6fc618..48ae30f2d9ab 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -2646,6 +2646,15 @@ Miscellaneous controller provides 3 interface files. If two misc resources (res_
> res_a 3
> res_b 0
>
> + misc.peak
> + A read-only flat-keyed file shown in the all cgroups. It shows
shown in all cgroups. It shows
> + the historical maximum usage of the resources in the cgroup and
> + its children.::
> +
> + $ cat misc.peak
> + res_a 10
> + res_b 8
> +
> misc.max
> A read-write flat-keyed file shown in the non root cgroups. Allowed
> maximum usage of the resources in the cgroup and its children.::
> diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h
> index e799b1f8d05b..8aa69818291e 100644
> --- a/include/linux/misc_cgroup.h
> +++ b/include/linux/misc_cgroup.h
> @@ -30,11 +30,13 @@ struct misc_cg;
> /**
> * struct misc_res: Per cgroup per misc type resource
> * @max: Maximum limit on the resource.
> + * $watermark: Historical maximum usage of the resource.
@watermark:
> * @usage: Current usage of the resource.
> * @events: Number of times, the resource limit exceeded.
> */
> struct misc_res {
> u64 max;
> + u64 watermark;
> atomic64_t usage;
> atomic64_t events;
> };
--
~Randy
Powered by blists - more mailing lists