All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Segall <bsegall@google.com>
To: Cheng Yu <serein.chengyu@huawei.com>
Cc: <mingo@redhat.com>,  <peterz@infradead.org>,
	 <juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
	 <dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
	 <mgorman@suse.de>,  <bristot@redhat.com>, <vschneid@redhat.com>,
	 <changhuaixin@linux.alibaba.com>, <shanpeic@linux.alibaba.com>,
	 <dtcccc@linux.alibaba.com>, <tj@kernel.org>,
	 <linux-kernel@vger.kernel.org>, <zhangqiao22@huawei.com>,
	 <judy.chenhui@huawei.com>, <yusongping@huawei.com>,
	 <zhaowenhui8@huawei.com>, <liaoqixin@huawei.com>
Subject: Re: [PATCH 2/2] sched/fair: set burst to zero when set max to cpu.max
Date: Tue, 28 May 2024 16:10:42 -0700	[thread overview]
Message-ID: <xm268qzt4jnx.fsf@google.com> (raw)
In-Reply-To: <20240522031007.643498-3-serein.chengyu@huawei.com> (Cheng Yu's message of "Wed, 22 May 2024 11:10:07 +0800")

Cheng Yu <serein.chengyu@huawei.com> writes:

> In the cgroup v2 cpu subsystem, assuming we have a cgroup named 'test',
> and we set cpu.max and cpu.max.burst:
>     # echo 1000000 > /sys/fs/cgroup/test/cpu.max
>     # echo 1000000 > /sys/fs/cgroup/test/cpu.max.burst
>
> Next we remove the restriction on cfs bandwidth:
>     # echo max > /sys/fs/cgroup/test/cpu.max
>     # cat /sys/fs/cgroup/test/cpu.max
>     max 100000
>     # cat /sys/fs/cgroup/test/cpu.max.burst
>     1000000
>
> Now we expect that the value of burst should be 0. When the burst is 0,
> it means that the restriction on burst is cancelled.
>
> Fixes: f4183717b370 ("sched/fair: Introduce the burstable CFS controller")
> Reported-by: Qixin Liao <liaoqixin@huawei.com>
> Signed-off-by: Cheng Yu <serein.chengyu@huawei.com>

Yeah, makes sense. My general assumption would be to put these in one
patch, but if there's a convention to separate v1 and v2 that I've
missed, I have no opinion.

Reviewed-by: Ben Segall <bsegall@google.com>

> ---
>  kernel/sched/core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index e9198e30bb74..982d357b3983 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -11414,8 +11414,11 @@ static ssize_t cpu_max_write(struct kernfs_open_file *of,
>  	int ret;
>  
>  	ret = cpu_period_quota_parse(buf, &period, &quota);
> -	if (!ret)
> +	if (!ret) {
> +		if (quota == RUNTIME_INF)
> +			burst = 0;
>  		ret = tg_set_cfs_bandwidth(tg, period, quota, burst);
> +	}
>  	return ret ?: nbytes;
>  }
>  #endif

  reply	other threads:[~2024-05-28 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  3:10 [PATCH 0/2] cgroup cpu: set burst to zero when cfs bandwidth is Cheng Yu
2024-05-22  3:10 ` [PATCH 1/2] sched/fair: limit burst to zero when cfs bandwidth is turned off Cheng Yu
2024-05-22  3:10 ` [PATCH 2/2] sched/fair: set burst to zero when set max to cpu.max Cheng Yu
2024-05-28 23:10   ` Benjamin Segall [this message]
2024-05-29  6:20     ` Cheng Yu
2024-05-24 10:52 ` [PATCH 0/2] cgroup cpu: set burst to zero when cfs bandwidth is Vishal Chourasia

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=xm268qzt4jnx.fsf@google.com \
    --to=bsegall@google.com \
    --cc=bristot@redhat.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=liaoqixin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=serein.chengyu@huawei.com \
    --cc=shanpeic@linux.alibaba.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.