From: Cheng Yu <serein.chengyu@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
<dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
<bsegall@google.com>, <mgorman@suse.de>, <bristot@redhat.com>,
<vschneid@redhat.com>, <changhuaixin@linux.alibaba.com>,
<shanpeic@linux.alibaba.com>, <dtcccc@linux.alibaba.com>,
<vishalc@linux.ibm.com>, <linux-kernel@vger.kernel.org>,
<zhangqiao22@huawei.com>, <judy.chenhui@huawei.com>,
<yusongping@huawei.com>, <zhaowenhui8@huawei.com>
Subject: Re: [PATCH v2] sched/fair: set burst to 0 when remove the restriction on cfs bandwidth
Date: Tue, 9 Jul 2024 12:04:56 +0800 [thread overview]
Message-ID: <22653c39-93a5-4958-a6fc-e31885f49373@huawei.com> (raw)
In-Reply-To: <ZowrFHHXNds36Nsb@slm.duckdns.org>
Hi,
On 2024/7/9 2:08, Tejun Heo wrote:
> Hello,
>
> On Mon, Jul 08, 2024 at 08:00:53PM +0800, Cheng Yu wrote:
>> From: Zhao Wenhui <zhaowenhui8@huawei.com>
>>
>> In the cpu subsystem of cgroup v1 and v2, we set the restriction on cfs
>> bandwidth by setting the quota and burst value. Later, when we remove
>> the restriction by setting the quota to the default value, the burst
>> value should also be forced to the its default value of zero.
>
> Explaining a bit why burst value should become zero can be helpful - ie.
> what happens when quota is not set but burst is limited?
When the restriction on cfs bandwidth is removed, the purpose of setting
burst value to zero is to avoid ambiguity.
>
> ...
>> @@ -10840,6 +10840,12 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,
>> burst + quota > max_cfs_runtime))
>> return -EINVAL;
>>
>> + /*
>> + * Ensure burst equals to zero when quota is -1.
>> + */
>> + if (quota == RUNTIME_INF && burst)
>> + return -EINVAL;
>
> This happening would be a bug, right? Would it make more sense to use
> WARN_ON_ONCE()?
As Vishal Chourasia mentioned, it can prevent setting excessively large
burst value. Using WARN_ON_ONCE() does not have this effect.
>
> Thanks.
>
Thanks
--
Cheng Yu
next prev parent reply other threads:[~2024-07-09 4:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 12:00 Cheng Yu
2024-07-08 18:08 ` Tejun Heo
2024-07-09 4:04 ` Cheng Yu [this message]
2024-08-09 8:54 ` zhaowenhui (A)
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=22653c39-93a5-4958-a6fc-e31885f49373@huawei.com \
--to=serein.chengyu@huawei.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=changhuaixin@linux.alibaba.com \
--cc=dietmar.eggemann@arm.com \
--cc=dtcccc@linux.alibaba.com \
--cc=judy.chenhui@huawei.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shanpeic@linux.alibaba.com \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vishalc@linux.ibm.com \
--cc=vschneid@redhat.com \
--cc=yusongping@huawei.com \
--cc=zhangqiao22@huawei.com \
--cc=zhaowenhui8@huawei.com \
/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®