Re: [PATCH] sched/fair: merge same code in enqueue_task_fair

From: Vincent Guittot
Date: Wed Dec 13 2023 - 03:24:01 EST


On Wed, 13 Dec 2023 at 08:04, Wang Jinchao <wangjinchao@xxxxxxxxxxx> wrote:
>
> On Mon, Dec 11, 2023 at 04:23:52PM +0100, Vincent Guittot wrote:
> > On Sun, 10 Dec 2023 at 10:22, WangJinchao <wangjinchao@xxxxxxxxxxx> wrote:
> > >
> > > 1. The code below is duplicated in two for loops and need to be
> > > consolidated
> > > 2. Fix the bug where a se's on_rq is true but its parent is not
> >
> > Could you clarify which bug you want to fix ?
> Taking into account the additional information provided by Tim,
> this is not a bug. Therefore, this patch is merely a logical
> simplification.

If there is no bug why changing it ?

The duplication is done in order to have the same pattern in :
enqueue_task_fair
dequeue_task_fair
throttle_cfs_rq
unthrottle_cfs_rq

so there is no need to change it

>
> I will send out a v2 and update the description in it.