[1/2] sched/topology: loop properly when clearing flags

Message ID 64955b50602fc64e2d3c7d4a92a1f9459e8c7ead.1708120036.git.mirq-linux@rere.qmqm.pl
State New
Headers
Series [1/2] sched/topology: loop properly when clearing flags |

Commit Message

Michał Mirosław Feb. 16, 2024, 9:55 p.m. UTC
  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 <mirq-linux@rere.qmqm.pl>
---
 kernel/sched/topology.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Vincent Guittot Feb. 19, 2024, 8:13 a.m. UTC | #1
On Fri, 16 Feb 2024 at 22:55, Michał Mirosław <mirq-linux@rere.qmqm.pl> 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 <mirq-linux@rere.qmqm.pl>
> ---
>  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/20230523105935.GN83892@hirez.programming.kicks-ass.net/T/#m0881c3e17954dc6e23f81216873e721f8395e554

and here
https://lore.kernel.org/lkml/20230617081926.2035113-1-linmiaohe@huawei.com/

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
>
  

Patch

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;