2024-02-16 22:07:30

by Michał Mirosław

[permalink] [raw]
Subject: [PATCH 1/2] sched/topology: loop properly when clearing flags

Fixed commit introduced sched_group::flags and a loop that was supposed
to clear groups' flags if the child sched_domain was deleted. The
iterating part was missing.

Fixes: 16d364ba6ef2 ("sched/topology: Introduce sched_group::flags")
Signed-off-by: Michał Mirosław <[email protected]>
---
kernel/sched/topology.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 10d1391e7416..75b1a18783c2 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -767,6 +767,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
*/
do {
sg->flags = 0;
+ sg = sg->next;
} while (sg != sd->groups);

sd->child = NULL;
--
2.39.2



2024-02-19 08:14:09

by Vincent Guittot

[permalink] [raw]
Subject: Re: [PATCH 1/2] sched/topology: loop properly when clearing flags

On Fri, 16 Feb 2024 at 22:55, Michał Mirosław <[email protected]> wrote:
>
> Fixed commit introduced sched_group::flags and a loop that was supposed
> to clear groups' flags if the child sched_domain was deleted. The
> iterating part was missing.
>
> Fixes: 16d364ba6ef2 ("sched/topology: Introduce sched_group::flags")
> Signed-off-by: Michał Mirosław <[email protected]>
> ---
> kernel/sched/topology.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 10d1391e7416..75b1a18783c2 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -767,6 +767,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
> */
> do {
> sg->flags = 0;
> + sg = sg->next;
> } while (sg != sd->groups);

This has been discussed here
https://lore.kernel.org/all/[email protected]/T/#m0881c3e17954dc6e23f81216873e721f8395e554

and here
https://lore.kernel.org/lkml/[email protected]/

and the right solution would be to remove the while loop but for
whatever the reason, this has never been resend with an updated commit
message

>
> sd->child = NULL;
> --
> 2.39.2
>