linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag
@ 2021-04-26 17:04 Gautham R. Shenoy
  2021-04-27  7:08 ` Vincent Guittot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gautham R. Shenoy @ 2021-04-26 17:04 UTC (permalink / raw)
  To: Mel Gorman, Peter Zijlstra (Intel),
	Ingo Molnar, Vincent Guittot, Srikar Dronamraju
  Cc: linux-kernel, Gautham R. Shenoy

From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>

In commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()"), in
select_idle_cpu(), we check if an idle core is present in the LLC of the
target CPU via the flag "has_idle_cores". We look for the idle core in
select_idle_cores(). If select_idle_cores() isn't able to find an idle
core/CPU, we need to unset the has_idle_cores flag in the LLC of the
target to prevent other CPUs from going down this route.

However, the current code is unsetting it in the LLC of the current CPU
instead of the target CPU. This patch fixes this issue.

Fixes: Commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.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 794c2cb..5fb5020 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6171,7 +6171,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
 	}
 
 	if (smt)
-		set_idle_cores(this, false);
+		set_idle_cores(target, false);
 
 	if (sched_feat(SIS_PROP) && !smt) {
 		time = cpu_clock(this) - time;
-- 
1.9.4


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

* Re: [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag
  2021-04-26 17:04 [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag Gautham R. Shenoy
@ 2021-04-27  7:08 ` Vincent Guittot
  2021-04-27  7:55 ` Mel Gorman
  2021-05-10 16:00 ` Gautham R Shenoy
  2 siblings, 0 replies; 4+ messages in thread
From: Vincent Guittot @ 2021-04-27  7:08 UTC (permalink / raw)
  To: Gautham R. Shenoy
  Cc: Mel Gorman, Peter Zijlstra (Intel),
	Ingo Molnar, Srikar Dronamraju, linux-kernel

On Mon, 26 Apr 2021 at 19:04, Gautham R. Shenoy <ego@linux.vnet.ibm.com> wrote:
>
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
>
> In commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()"), in
> select_idle_cpu(), we check if an idle core is present in the LLC of the
> target CPU via the flag "has_idle_cores". We look for the idle core in
> select_idle_cores(). If select_idle_cores() isn't able to find an idle
> core/CPU, we need to unset the has_idle_cores flag in the LLC of the
> target to prevent other CPUs from going down this route.
>
> However, the current code is unsetting it in the LLC of the current CPU
> instead of the target CPU. This patch fixes this issue.
>
> Fixes: Commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

> ---
>  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 794c2cb..5fb5020 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6171,7 +6171,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
>         }
>
>         if (smt)
> -               set_idle_cores(this, false);
> +               set_idle_cores(target, false);
>
>         if (sched_feat(SIS_PROP) && !smt) {
>                 time = cpu_clock(this) - time;
> --
> 1.9.4
>

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

* Re: [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag
  2021-04-26 17:04 [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag Gautham R. Shenoy
  2021-04-27  7:08 ` Vincent Guittot
@ 2021-04-27  7:55 ` Mel Gorman
  2021-05-10 16:00 ` Gautham R Shenoy
  2 siblings, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2021-04-27  7:55 UTC (permalink / raw)
  To: Gautham R. Shenoy
  Cc: Peter Zijlstra (Intel),
	Ingo Molnar, Vincent Guittot, Srikar Dronamraju, linux-kernel

On Mon, Apr 26, 2021 at 10:34:12PM +0530, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
> 
> In commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()"), in
> select_idle_cpu(), we check if an idle core is present in the LLC of the
> target CPU via the flag "has_idle_cores". We look for the idle core in
> select_idle_cores(). If select_idle_cores() isn't able to find an idle
> core/CPU, we need to unset the has_idle_cores flag in the LLC of the
> target to prevent other CPUs from going down this route.
> 
> However, the current code is unsetting it in the LLC of the current CPU
> instead of the target CPU. This patch fixes this issue.
> 
> Fixes: Commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag
  2021-04-26 17:04 [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag Gautham R. Shenoy
  2021-04-27  7:08 ` Vincent Guittot
  2021-04-27  7:55 ` Mel Gorman
@ 2021-05-10 16:00 ` Gautham R Shenoy
  2 siblings, 0 replies; 4+ messages in thread
From: Gautham R Shenoy @ 2021-05-10 16:00 UTC (permalink / raw)
  To: Gautham R. Shenoy
  Cc: Mel Gorman, Peter Zijlstra (Intel),
	Ingo Molnar, Vincent Guittot, Srikar Dronamraju, linux-kernel

Peter, Ingo,

Pinging to check on this tiny fix :-)


On Mon, Apr 26, 2021 at 10:34:12PM +0530, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
> 
> In commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()"), in
> select_idle_cpu(), we check if an idle core is present in the LLC of the
> target CPU via the flag "has_idle_cores". We look for the idle core in
> select_idle_cores(). If select_idle_cores() isn't able to find an idle
> core/CPU, we need to unset the has_idle_cores flag in the LLC of the
> target to prevent other CPUs from going down this route.
> 
> However, the current code is unsetting it in the LLC of the current CPU
> instead of the target CPU. This patch fixes this issue.
> 
> Fixes: Commit 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()")
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.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 794c2cb..5fb5020 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6171,7 +6171,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
>  	}
> 
>  	if (smt)
> -		set_idle_cores(this, false);
> +		set_idle_cores(target, false);
> 
>  	if (sched_feat(SIS_PROP) && !smt) {
>  		time = cpu_clock(this) - time;
> -- 
> 1.9.4
> 

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

end of thread, other threads:[~2021-05-10 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 17:04 [PATCH] sched/fair: Fix unsetting of "has_idle_cores" flag Gautham R. Shenoy
2021-04-27  7:08 ` Vincent Guittot
2021-04-27  7:55 ` Mel Gorman
2021-05-10 16:00 ` Gautham R Shenoy

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