LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] is_core_idle() is using a wrong variable
@ 2021-07-22  6:39 mika.penttila
  2021-07-28 10:41 ` Peter Zijlstra
  2021-08-05  9:34 ` [tip: sched/core] sched/numa: Fix is_core_idle() tip-bot2 for Mika Penttilä
  0 siblings, 2 replies; 5+ messages in thread
From: mika.penttila @ 2021-07-22  6:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: lirongqing, pbonzini, mingo, peterz, kvm, Mika Penttilä

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(-)

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] is_core_idle() is using a wrong variable
  2021-07-22  6:39 [PATCH] is_core_idle() is using a wrong variable mika.penttila
@ 2021-07-28 10:41 ` Peter Zijlstra
  2021-07-28 11:50   ` Mel Gorman
  2021-07-29  4:26   ` Pankaj Gupta
  2021-08-05  9:34 ` [tip: sched/core] sched/numa: Fix is_core_idle() tip-bot2 for Mika Penttilä
  1 sibling, 2 replies; 5+ messages in thread
From: Peter Zijlstra @ 2021-07-28 10:41 UTC (permalink / raw)
  To: mika.penttila; +Cc: linux-kernel, lirongqing, pbonzini, mingo, kvm, Mel Gorman

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] is_core_idle() is using a wrong variable
  2021-07-28 10:41 ` Peter Zijlstra
@ 2021-07-28 11:50   ` Mel Gorman
  2021-07-29  4:26   ` Pankaj Gupta
  1 sibling, 0 replies; 5+ messages in thread
From: Mel Gorman @ 2021-07-28 11:50 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: mika.penttila, linux-kernel, lirongqing, pbonzini, mingo, kvm,
	Mel Gorman

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>

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] is_core_idle() is using a wrong variable
  2021-07-28 10:41 ` Peter Zijlstra
  2021-07-28 11:50   ` Mel Gorman
@ 2021-07-29  4:26   ` Pankaj Gupta
  1 sibling, 0 replies; 5+ messages in thread
From: Pankaj Gupta @ 2021-07-29  4:26 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: mika.penttila, LKML, Li RongQing, Paolo Bonzini, Ingo Molnar,
	kvm, Mel Gorman

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: sched/core] sched/numa: Fix is_core_idle()
  2021-07-22  6:39 [PATCH] is_core_idle() is using a wrong variable mika.penttila
  2021-07-28 10:41 ` Peter Zijlstra
@ 2021-08-05  9:34 ` tip-bot2 for Mika Penttilä
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Mika Penttilä @ 2021-08-05  9:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mika.penttila, Peter Zijlstra (Intel),
	Mel Gorman, Pankaj Gupta, x86, linux-kernel

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ä <mika.penttila@gmail.com>
AuthorDate:    Thu, 22 Jul 2021 09:39:46 +03:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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ä <mika.penttila@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Pankaj Gupta <pankaj.gupta@ionos.com>
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(-)

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-05  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  6:39 [PATCH] is_core_idle() is using a wrong variable mika.penttila
2021-07-28 10:41 ` Peter Zijlstra
2021-07-28 11:50   ` Mel Gorman
2021-07-29  4:26   ` Pankaj Gupta
2021-08-05  9:34 ` [tip: sched/core] sched/numa: Fix is_core_idle() tip-bot2 for Mika Penttilä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).