mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr
@ 2023-06-20  8:07 Miaohe Lin
  2023-06-20 17:49 ` Phil Auld
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Miaohe Lin @ 2023-06-20  8:07 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, bristot, vschneid,
	linux-kernel, linmiaohe

When checking whether a recently used CPU can be a potential idle
candidate, recent_used_cpu should be used to test p->cpus_ptr as
p->recent_used_cpu is not equal to recent_used_cpu and candidate
decision is made based on recent_used_cpu here.

Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.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 7666dbc2b788..3cc06cfca350 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7156,7 +7156,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
 	    recent_used_cpu != target &&
 	    cpus_share_cache(recent_used_cpu, target) &&
 	    (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&
-	    cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) &&
+	    cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) &&
 	    asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) {
 		return recent_used_cpu;
 	}
-- 
2.27.0


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

* Re: [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr
  2023-06-20  8:07 [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr Miaohe Lin
@ 2023-06-20 17:49 ` Phil Auld
  2023-06-21 10:19 ` Mel Gorman
  2023-07-10  8:13 ` [tip: sched/urgent] " tip-bot2 for Miaohe Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Phil Auld @ 2023-06-20 17:49 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel

On Tue, Jun 20, 2023 at 04:07:47PM +0800 Miaohe Lin wrote:
> When checking whether a recently used CPU can be a potential idle
> candidate, recent_used_cpu should be used to test p->cpus_ptr as
> p->recent_used_cpu is not equal to recent_used_cpu and candidate
> decision is made based on recent_used_cpu here.
> 
> Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu")
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.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 7666dbc2b788..3cc06cfca350 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7156,7 +7156,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
>  	    recent_used_cpu != target &&
>  	    cpus_share_cache(recent_used_cpu, target) &&
>  	    (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&
> -	    cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) &&
> +	    cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) &&
>  	    asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) {
>  		return recent_used_cpu;
>  	}
> -- 
> 2.27.0
> 

This looks correct to me.

Reviewed-by: Phil Auld <pauld@redhat.com>


-- 


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

* Re: [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr
  2023-06-20  8:07 [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr Miaohe Lin
  2023-06-20 17:49 ` Phil Auld
@ 2023-06-21 10:19 ` Mel Gorman
  2023-06-21 11:32   ` Peter Zijlstra
  2023-07-10  8:13 ` [tip: sched/urgent] " tip-bot2 for Miaohe Lin
  2 siblings, 1 reply; 5+ messages in thread
From: Mel Gorman @ 2023-06-21 10:19 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, bristot, vschneid, linux-kernel

On Tue, Jun 20, 2023 at 04:07:47PM +0800, Miaohe Lin wrote:
> When checking whether a recently used CPU can be a potential idle
> candidate, recent_used_cpu should be used to test p->cpus_ptr as
> p->recent_used_cpu is not equal to recent_used_cpu and candidate
> decision is made based on recent_used_cpu here.
> 
> Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu")

Acked-by: Mel Gorman <mgorman@suse.de>

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr
  2023-06-21 10:19 ` Mel Gorman
@ 2023-06-21 11:32   ` Peter Zijlstra
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2023-06-21 11:32 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Miaohe Lin, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, bristot, vschneid, linux-kernel

On Wed, Jun 21, 2023 at 11:19:15AM +0100, Mel Gorman wrote:
> On Tue, Jun 20, 2023 at 04:07:47PM +0800, Miaohe Lin wrote:
> > When checking whether a recently used CPU can be a potential idle
> > candidate, recent_used_cpu should be used to test p->cpus_ptr as
> > p->recent_used_cpu is not equal to recent_used_cpu and candidate
> > decision is made based on recent_used_cpu here.
> > 
> > Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu")
> 
> Acked-by: Mel Gorman <mgorman@suse.de>

Thanks!

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

* [tip: sched/urgent] sched/fair: Use recent_used_cpu to test p->cpus_ptr
  2023-06-20  8:07 [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr Miaohe Lin
  2023-06-20 17:49 ` Phil Auld
  2023-06-21 10:19 ` Mel Gorman
@ 2023-07-10  8:13 ` tip-bot2 for Miaohe Lin
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Miaohe Lin @ 2023-07-10  8:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Miaohe Lin, Peter Zijlstra (Intel),
	Phil Auld, Mel Gorman, x86, linux-kernel

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

Commit-ID:     ae2ad293d6be143ad223f5f947cca07bcbe42595
Gitweb:        https://git.kernel.org/tip/ae2ad293d6be143ad223f5f947cca07bcbe42595
Author:        Miaohe Lin <linmiaohe@huawei.com>
AuthorDate:    Tue, 20 Jun 2023 16:07:47 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 10 Jul 2023 09:52:30 +02:00

sched/fair: Use recent_used_cpu to test p->cpus_ptr

When checking whether a recently used CPU can be a potential idle
candidate, recent_used_cpu should be used to test p->cpus_ptr as
p->recent_used_cpu is not equal to recent_used_cpu and candidate
decision is made based on recent_used_cpu here.

Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Link: https://lore.kernel.org/r/20230620080747.359122-1-linmiaohe@huawei.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 a80a739..b3e25be 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7174,7 +7174,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
 	    recent_used_cpu != target &&
 	    cpus_share_cache(recent_used_cpu, target) &&
 	    (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&
-	    cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) &&
+	    cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) &&
 	    asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) {
 		return recent_used_cpu;
 	}

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

end of thread, other threads:[~2023-07-10  8:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20  8:07 [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr Miaohe Lin
2023-06-20 17:49 ` Phil Auld
2023-06-21 10:19 ` Mel Gorman
2023-06-21 11:32   ` Peter Zijlstra
2023-07-10  8:13 ` [tip: sched/urgent] " tip-bot2 for Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome