diff mbox series

is_core_idle() is using a wrong variable

Message ID 20210722063946.28951-1-mika.penttila@gmail.com (mailing list archive)
State New, archived
Headers show
Series is_core_idle() is using a wrong variable | expand

Commit Message

mika.penttila@gmail.com July 22, 2021, 6:39 a.m. UTC
From: Mika Penttilä <mika.penttila@gmail.com>

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

Signed-off-by: Mika Penttilä <mika.penttila@gmail.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Zijlstra July 28, 2021, 10:41 a.m. UTC | #1
On Thu, Jul 22, 2021 at 09:39:46AM +0300, mika.penttila@gmail.com wrote:
> From: Mika Penttilä <mika.penttila@gmail.com>
> 
> is_core_idle() was using a wrong variable in the loop test. Fix it.
> 
> Signed-off-by: Mika Penttilä <mika.penttila@gmail.com>

Thanks!

---
Subject: sched/numa: Fix is_core_idle()
From: Mika Penttilä <mika.penttila@gmail.com>
Date: Thu, 22 Jul 2021 09:39:46 +0300

From: Mika Penttilä <mika.penttila@gmail.com>

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ä <mika.penttila@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210722063946.28951-1-mika.penttila@gmail.com
---
 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
Mel Gorman July 28, 2021, 11:50 a.m. UTC | #2
On Wed, Jul 28, 2021 at 12:41:03PM +0200, Peter Zijlstra wrote:
> On Thu, Jul 22, 2021 at 09:39:46AM +0300, mika.penttila@gmail.com wrote:
> > From: Mika Penttilä <mika.penttila@gmail.com>
> > 
> > is_core_idle() was using a wrong variable in the loop test. Fix it.
> > 
> > Signed-off-by: Mika Penttilä <mika.penttila@gmail.com>
> 
> Thanks!
> 
> ---
> Subject: sched/numa: Fix is_core_idle()
> From: Mika Penttilä <mika.penttila@gmail.com>
> Date: Thu, 22 Jul 2021 09:39:46 +0300
> 
> From: Mika Penttilä <mika.penttila@gmail.com>
> 
> 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ä <mika.penttila@gmail.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Link: https://lkml.kernel.org/r/20210722063946.28951-1-mika.penttila@gmail.com

Acked-by: Mel Gorman <mgorman@techsingularity.net>
Pankaj Gupta July 29, 2021, 4:26 a.m. UTC | #3
On Wed, 28 Jul 2021 at 12:46, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Thu, Jul 22, 2021 at 09:39:46AM +0300, mika.penttila@gmail.com wrote:
> > From: Mika Penttilä <mika.penttila@gmail.com>
> >
> > is_core_idle() was using a wrong variable in the loop test. Fix it.
> >
> > Signed-off-by: Mika Penttilä <mika.penttila@gmail.com>
>
> Thanks!
>
> ---
> Subject: sched/numa: Fix is_core_idle()
> From: Mika Penttilä <mika.penttila@gmail.com>
> Date: Thu, 22 Jul 2021 09:39:46 +0300
>
> From: Mika Penttilä <mika.penttila@gmail.com>
>
> 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ä <mika.penttila@gmail.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Link: https://lkml.kernel.org/r/20210722063946.28951-1-mika.penttila@gmail.com
> ---
>  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 <pankaj.gupta@ionos.com>
diff mbox series

Patch

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