mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: <mingo@redhat.com>, <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>, <dietmar.eggemann@arm.com>,
	<rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>,
	<bristot@redhat.com>, <vschneid@redhat.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/topology: remove unneeded do while loop in cpu_attach_domain()
Date: Wed, 21 Jun 2023 10:53:57 +0800	[thread overview]
Message-ID: <53a9ec35-8332-755c-40ed-54315ffb0d78@huawei.com> (raw)
In-Reply-To: <20230620141120.GA2016469@hirez.programming.kicks-ass.net>

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);
> 
> as I noted here:
> 
>   https://lore.kernel.org/all/20230523105935.GN83892@hirez.programming.kicks-ass.net/T/#u

[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
"

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.

Thanks.

  reply	other threads:[~2023-06-21  2:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  8:19 Miaohe Lin
2023-06-18 16:32 ` Chen Yu
2023-06-20 14:11 ` Peter Zijlstra
2023-06-21  2:53   ` Miaohe Lin [this message]
2023-06-21 13:11     ` Ricardo Neri
2023-06-21 18:57       ` Ricardo Neri
2023-06-25  1:59         ` Miaohe Lin
2023-07-12 18:33           ` Ricardo Neri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53a9ec35-8332-755c-40ed-54315ffb0d78@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®