linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Honglei Wang <wanghonglei@didichuxing.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	linux-kernel@vger.kernel.org,
	Huaixin Chang <changhuaixin@linux.alibaba.com>,
	Honglei Wang <jameshongleiwang@126.com>
Subject: Re: [PATCH v2 1/3] sched/fair: avoid burst statistic if it's not set
Date: Thu, 9 Dec 2021 13:22:08 +0100	[thread overview]
Message-ID: <YbH08Nw3WpyxElE9@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20211208145018.64657-1-wanghonglei@didichuxing.com>

On Wed, Dec 08, 2021 at 10:50:18PM +0800, Honglei Wang wrote:
> It's not necessary to do burst associated statistic and calculation for
> runtime if the burst feature is not set at all. Just return at the very
> start point if so.
> 
> Signed-off-by: Honglei Wang <wanghonglei@didichuxing.com>
> ---
>  kernel/sched/fair.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6e476f6d9435..2cd626c22912 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4640,6 +4640,11 @@ void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b)
>  	if (unlikely(cfs_b->quota == RUNTIME_INF))
>  		return;
>  
> +	if (cfs_b->burst == 0 && cfs_b->runtime_snap == cfs_b->quota) {
> +		cfs_b->runtime = cfs_b->quota;
> +		return;
> +	}
> +
>  	cfs_b->runtime += cfs_b->quota;
>  	runtime = cfs_b->runtime_snap - cfs_b->runtime;
>  	if (runtime > 0) {

What actual purpose does this patch serve, other than to increase the
line-count?

  reply	other threads:[~2021-12-09 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 14:50 [PATCH v2 1/3] sched/fair: avoid burst statistic if it's not set Honglei Wang
2021-12-09 12:22 ` Peter Zijlstra [this message]
2021-12-09 15:24   ` Honglei Wang

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=YbH08Nw3WpyxElE9@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=changhuaixin@linux.alibaba.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jameshongleiwang@126.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wanghonglei@didichuxing.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;
as well as URLs for NNTP newsgroup(s).