mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: mingo@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, bsegall@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: optimize entity_tick()
Date: Mon, 18 Jul 2022 12:10:29 +0200	[thread overview]
Message-ID: <YtUxlVPGftwLWQNV@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220718094937.37360-1-zhangpeng.00@bytedance.com>

On Mon, Jul 18, 2022 at 05:49:37PM +0800, Peng Zhang wrote:
> From: "zhangpeng.00" <zhangpeng.00@bytedance.com>
> 
> entity_tick() will be called to check preemption by calculating each
> sched_entity's time_slice in a task group tree from bottom to top.
> 
> If a need_resched_flag is set by a checking of a sched_entity,
> there is no necessary to check preemption of the sched_entity's
> parent and ancestor entity.
> 
> So we can test if the need_resched_flag has been set before calling
> check_preempt_tick() to avoid unnecessary calculations.
> 
> Signed-off-by: zhangpeng.00 <zhangpeng.00@bytedance.com>

Optimization patches should come with numbers showing they're worth it.

Also; did you consider side-effects from check_preempt_tick(), like
clearing buddy state etc.. ?

  reply	other threads:[~2022-07-18 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  9:49 Peng Zhang
2022-07-18 10:10 ` Peter Zijlstra [this message]
2022-07-18 18:53 ` kernel test robot

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=YtUxlVPGftwLWQNV@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=vincent.guittot@linaro.org \
    --cc=zhangpeng.00@bytedance.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®