Messages in this thread | | | Date | Thu, 1 Oct 2020 09:33:09 +0200 | From | Peter Zijlstra <> | 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@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!
| |