[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201001073309.GL2628@hirez.programming.kicks-ass.net>
Date: Thu, 1 Oct 2020 09:33:09 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Peter Oskolkov <posk@...gle.com>, Ingo Molnar <mingo@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peter Oskolkov <posk@...k.io>
Subject: Re: [PATCH] sched/fair: tweak pick_next_entity
On Thu, Oct 01, 2020 at 09:17:43AM +0200, Vincent Guittot wrote:
> On Wed, 30 Sep 2020 at 19:35, Peter Oskolkov <posk@...gle.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@...gle.com>
>
> Reviewed-by: Vincent Guittot <vincent.guitttot@...aro.org>
Thanks!
Powered by blists - more mailing lists