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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Jun 2023 06:11:59 -0700
From:   Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To:     Miaohe Lin <linmiaohe@...wei.com>
Cc:     Peter Zijlstra <peterz@...radead.org>, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
        mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
        linux-kernel@...r.kernel.org, yu.c.chen@...el.com,
        tim.c.chen@...el.com
Subject: Re: [PATCH] sched/topology: remove unneeded do while loop in
 cpu_attach_domain()

On Wed, Jun 21, 2023 at 10:53:57AM +0800, Miaohe Lin wrote:
> On 2023/6/20 22:11, Peter Zijlstra wrote:
> > On Sat, Jun 17, 2023 at 04:19:26PM +0800, Miaohe Lin wrote:
> >> When sg != sd->groups, the do while loop would cause deadloop here. But
> >> that won't occur because sg is always equal to sd->groups now. Remove
> >> this unneeded do while loop.
> > 
> > This Changelog makes no sense to me.. Yes, as is the do {} while loop is
> > dead code, but it *should* have read like:
> > 
> > 	do {
> > 		sg->flags = 0;
> > 		sg = sg->next;
> > 	} while (sg != sd->groups);

Yes, I agree that this is the correct solution.

> > 
> > as I noted here:
> > 
> >   https://lore.kernel.org/all/20230523105935.GN83892@hirez.programming.kicks-ass.net/T/#u

I apologize. I missed this e-mail.

> 
> [1]
> 
> > 
> > So what this changelog should argue is how there cannot be multiple
> > groups here -- or if there can be, add the missing iteration.
> 
> [1] said:
> "
> Yes, I missed that.
> 
> That being said, the only reason for sd to be degenerate is that there
> is only 1 group. Otherwise we will keep it and degenerate parents
> instead
> "

In the section of the code in question ,`sd` now points to the parent of the
sched group being degenerated. Thus, it may have more than one group, and we should
iterate over them to clear the flags.

> 
> IOW, "sg = sg->next;" is missed intentionally in the do while{} loop to show that
> there's only 1 sched group. This looks weird to me but no persist on change the code.

Not having `sg = sg->next;` is a bug, IMO.

Thanks and BR,
Ricardo 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ