Re: [PATCH 1/2] sched/fair: Remove redundant lookup of rq in check_preempt_wakeup
From: Vincent Guittot
Date: Tue Sep 21 2021 - 04:12:24 EST
On Tue, 21 Sept 2021 at 09:53, Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Sep 21, 2021 at 09:21:16AM +0200, Vincent Guittot wrote:
> > On Mon, 20 Sept 2021 at 16:26, Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > The rq for curr is read during the function preamble, remove the
> > > redundant lookup.
> > >
> > > Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
> > > ---
> > > kernel/sched/fair.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > > index ff69f245b939..038edfaaae9e 100644
> > > --- a/kernel/sched/fair.c
> > > +++ b/kernel/sched/fair.c
> > > @@ -7190,7 +7190,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
> > > if (cse_is_idle != pse_is_idle)
> > > return;
> > >
> > > - update_curr(cfs_rq_of(se));
> > > + update_curr(cfs_rq);
> >
> > se can have been modified by find_matching_se(&se, &pse)
> >
>
> I still expected the cfs_rq to be the same, particularly given that the
> context is about preempting the current task on a runqueue. Is that
> wrong?
As soon as the tasks don't belong to the same cgroup, se can be
modified and cfs_rq will not be the same
>
> --
> Mel Gorman
> SUSE Labs