mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: xiujianfeng <xiujianfeng@huawei.com>
To: Randy Dunlap <rdunlap@infradead.org>, <tj@kernel.org>,
	<lizefan.x@bytedance.com>, <hannes@cmpxchg.org>, <corbet@lwn.net>,
	<kamalesh.babulal@oracle.com>, <haitao.huang@linux.intel.com>
Cc: <cgroups@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] cgroup/misc: Introduce misc.peak
Date: Tue, 2 Jul 2024 08:19:07 +0800	[thread overview]
Message-ID: <a7dbb226-9382-fe4f-43b2-9ce46c12026d@huawei.com> (raw)
In-Reply-To: <047579c5-582a-46ac-8967-e9ca9a90cea7@infradead.org>



On 2024/7/1 23:01, Randy Dunlap wrote:
> 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@huawei.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

Thanks for your review, will fix it in v2.
> 
>> +        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;
>>  };
> 
> 

  reply	other threads:[~2024-07-02  0:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 12:52 Xiu Jianfeng
2024-07-01 15:01 ` Randy Dunlap
2024-07-02  0:19   ` xiujianfeng [this message]
2024-07-01 17:19 ` Tejun Heo
2024-07-02  0:20   ` xiujianfeng

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=a7dbb226-9382-fe4f-43b2-9ce46c12026d@huawei.com \
    --to=xiujianfeng@huawei.com \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=haitao.huang@linux.intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamalesh.babulal@oracle.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=rdunlap@infradead.org \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®