lkml.org 
[lkml]   [2023]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] sched/eevdf: O(1) fastpath for task selection
On Tue, Nov 07, 2023 at 06:12:49PM +0800, Abel Wu wrote:

> > @@ -904,7 +905,7 @@ static struct sched_entity *pick_eevdf(struct cfs_rq *cfs_rq)
> > * in this cfs_rq, saving some cycles.
> > */
> > if (cfs_rq->nr_running == 1)
> > - return curr && curr->on_rq ? curr : __node_2_se(node);
> > + return curr && curr->on_rq ? curr : se;
>
> Maybe we can reduce memory footprint on curr by:
>
> return se ? se : curr;

Irrespective, I think that logic makes more sense. If we know we have
but one task and the tree has a task, it must be that task, otherwise,
current must be it.

Anyway, I was still staring at the previous patch, flipping the tree
around like that is clever. Yes I suppose that ought to work just fine.

\
 
 \ /
  Last update: 2023-11-20 13:51    [W:0.045 / U:2.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site