From: Peter Zijlstra <peterz@infradead.org>
To: Miaohe Lin <linmiaohe@huawei.com>
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: Tue, 20 Jun 2023 16:11:20 +0200 [thread overview]
Message-ID: <20230620141120.GA2016469@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230617081926.2035113-1-linmiaohe@huawei.com>
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
So what this changelog should argue is how there cannot be multiple
groups here -- or if there can be, add the missing iteration.
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> kernel/sched/topology.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index ca4472281c28..9010c93c3fdb 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -750,10 +750,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
> * domain for convenience. Clear such flags since
> * the child is being destroyed.
> */
> - do {
> - sg->flags = 0;
> - } while (sg != sd->groups);
> -
> + sg->flags = 0;
> sd->child = NULL;
> }
> }
> --
> 2.27.0
>
next prev parent reply other threads:[~2023-06-20 14:12 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 [this message]
2023-06-21 2:53 ` Miaohe Lin
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=20230620141120.GA2016469@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--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
Powered by JetHome