mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Peter Oskolkov <posk@google.com>, Ingo Molnar <mingo@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Peter Oskolkov <posk@posk.io>
Subject: Re: [PATCH] sched/fair: tweak pick_next_entity
Date: Thu, 1 Oct 2020 09:33:09 +0200	[thread overview]
Message-ID: <20201001073309.GL2628@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtBbaw5Ny_qmdhwiQyErfpE+GehY3wTMUxNVtfBjnAVC5w@mail.gmail.com>

On Thu, Oct 01, 2020 at 09:17:43AM +0200, Vincent Guittot wrote:
> On Wed, 30 Sep 2020 at 19:35, Peter Oskolkov <posk@google.com> wrote:
> >
> > Currently, pick_next_entity(...) has the following structure
> > (simplified):
> >
> > [...]
> > if (last_buddy_ok())
> >   result = last_buddy;
> > if (next_buddy_ok())
> >   result = next_buddy;
> > [...]
> >
> > The intended behavior is to prefer next buddy over last buddy;
> > the current code somewhat obfuscates this, and also wastes
> > cycles checking the last buddy when eventually the next buddy is
> > picked up.
> >
> > So this patch refactors two 'ifs' above into
> >
> > [...]
> > if (next_buddy_ok())
> >     result = next_buddy;
> > else if (last_buddy_ok())
> >     result = last_buddy;
> > [...]
> >
> > Signed-off-by: Peter Oskolkov <posk@google.com>
> 
> Reviewed-by: Vincent Guittot <vincent.guitttot@linaro.org>

Thanks!

  reply	other threads:[~2020-10-01  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 17:35 Peter Oskolkov
2020-10-01  7:17 ` Vincent Guittot
2020-10-01  7:33   ` Peter Zijlstra [this message]
2020-10-05  7:43 ` [tip: sched/core] sched/fair: Tweak pick_next_entity() tip-bot2 for Peter Oskolkov

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=20201001073309.GL2628@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=posk@google.com \
    --cc=posk@posk.io \
    --cc=vincent.guittot@linaro.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

Powered by JetHome