2021-07-22 06:41:20

by mika.penttila

[permalink] [raw]
Subject: [PATCH] is_core_idle() is using a wrong variable

From: Mika Penttilä <[email protected]>

is_core_idle() was using a wrong variable in the loop test. Fix it.

Signed-off-by: Mika Penttilä <[email protected]>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 44c452072a1b..30a6984a58f7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
if (cpu == sibling)
continue;

- if (!idle_cpu(cpu))
+ if (!idle_cpu(sibling))
return false;
}
#endif
--
2.17.1


2021-07-28 11:52:20

by Mel Gorman

[permalink] [raw]
Subject: Re: [PATCH] is_core_idle() is using a wrong variable

On Wed, Jul 28, 2021 at 12:41:03PM +0200, Peter Zijlstra wrote:
> On Thu, Jul 22, 2021 at 09:39:46AM +0300, [email protected] wrote:
> > From: Mika Penttil? <[email protected]>
> >
> > is_core_idle() was using a wrong variable in the loop test. Fix it.
> >
> > Signed-off-by: Mika Penttil? <[email protected]>
>
> Thanks!
>
> ---
> Subject: sched/numa: Fix is_core_idle()
> From: Mika Penttil? <[email protected]>
> Date: Thu, 22 Jul 2021 09:39:46 +0300
>
> From: Mika Penttil? <[email protected]>
>
> Use the loop variable instead of the function argument to test the
> other SMT siblings for idle.
>
> Fixes: ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
> Signed-off-by: Mika Penttil? <[email protected]>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> Link: https://lkml.kernel.org/r/[email protected]

Acked-by: Mel Gorman <[email protected]>

--
Mel Gorman
SUSE Labs

2021-07-29 04:30:25

by Pankaj Gupta

[permalink] [raw]
Subject: Re: [PATCH] is_core_idle() is using a wrong variable

On Wed, 28 Jul 2021 at 12:46, Peter Zijlstra <[email protected]> wrote:
>
> On Thu, Jul 22, 2021 at 09:39:46AM +0300, [email protected] wrote:
> > From: Mika Penttilä <[email protected]>
> >
> > is_core_idle() was using a wrong variable in the loop test. Fix it.
> >
> > Signed-off-by: Mika Penttilä <[email protected]>
>
> Thanks!
>
> ---
> Subject: sched/numa: Fix is_core_idle()
> From: Mika Penttilä <[email protected]>
> Date: Thu, 22 Jul 2021 09:39:46 +0300
>
> From: Mika Penttilä <[email protected]>
>
> Use the loop variable instead of the function argument to test the
> other SMT siblings for idle.
>
> Fixes: ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
> Signed-off-by: Mika Penttilä <[email protected]>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> Link: https://lkml.kernel.org/r/[email protected]
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
> if (cpu == sibling)
> continue;
>
> - if (!idle_cpu(cpu))
> + if (!idle_cpu(sibling))
> return false;
> }
> #endif

Acked-by: Pankaj Gupta <[email protected]>

2021-08-05 09:39:18

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: sched/core] sched/numa: Fix is_core_idle()

The following commit has been merged into the sched/core branch of tip:

Commit-ID: 1c6829cfd3d5124b125e6df41158665aea413b35
Gitweb: https://git.kernel.org/tip/1c6829cfd3d5124b125e6df41158665aea413b35
Author: Mika Penttilä <[email protected]>
AuthorDate: Thu, 22 Jul 2021 09:39:46 +03:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Wed, 04 Aug 2021 15:16:43 +02:00

sched/numa: Fix is_core_idle()

Use the loop variable instead of the function argument to test the
other SMT siblings for idle.

Fixes: ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
Signed-off-by: Mika Penttilä <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Acked-by: Pankaj Gupta <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 11d2294..13c3fd4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
if (cpu == sibling)
continue;

- if (!idle_cpu(cpu))
+ if (!idle_cpu(sibling))
return false;
}
#endif