lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210921100323.GL3959@techsingularity.net>
Date:   Tue, 21 Sep 2021 11:03:23 +0100
From:   Mel Gorman <mgorman@...hsingularity.net>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Vincent Guittot <vincent.guittot@...aro.org>,
        Ingo Molnar <mingo@...nel.org>,
        Valentin Schneider <valentin.schneider@....com>,
        Aubrey Li <aubrey.li@...ux.intel.com>,
        Barry Song <song.bao.hua@...ilicon.com>,
        Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] sched/fair: Remove redundant lookup of rq in
 check_preempt_wakeup

On Tue, Sep 21, 2021 at 10:21:19AM +0200, Peter Zijlstra wrote:
> On Tue, Sep 21, 2021 at 08:53:09AM +0100, Mel Gorman 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@...hsingularity.net> wrote:
> > > >
> > > > The rq for curr is read during the function preamble, remove the
> > > > redundant lookup.
> > > >
> > > > Signed-off-by: Mel Gorman <mgorman@...hsingularity.net>
> > > > ---
> > > >  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?
> 
> Yes. There's a cfs_rq for every se. What we do in find_matching_se() is
> walk up the hiarachy until both are in the same cfs_rq, otherwse we
> cannot compare them.
> 
> Fundamentally this means the effective cfs_rq also changes.

Ok, thanks. I'll read into this more but the patch is dead.

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ