Skip to contentSkip to conversation

sched/fair: Drop the redundant setting of recent_used_cpu

PATCH In review Li RongQing 2 participants 2 messages Sep 30, 2021 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Drop the redundant setting of recent_used_cpu

recent_used_cpu has been set to prev before check

---
 kernel/sched/fair.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
kernel/sched/fair.c +1 -7
index 7b9fe8c..ec42eaa 100644
@@ -6437,14 +6437,8 @@ static int select_idle_sibling(struct task_struct *p, int prev, int 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) &&
-	    asym_fits_capacity(task_util, recent_used_cpu)) {
-		/*
-		 * Replace recent_used_cpu with prev as it is a potential
-		 * candidate for the next wake:
-		 */
-		p->recent_used_cpu = prev;
+	    asym_fits_capacity(task_util, recent_used_cpu))
 		return recent_used_cpu;
-	}
 
 	/*
 	 * For asymmetric CPU capacity systems, our domain of interest is
Signature · 1 line
1.7.1
#1 lore raw
Quoted 18 lines · Li RongQing

recent_used_cpu has been set to prev before check

---
 kernel/sched/fair.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
kernel/sched/fair.c +0 -2
index 7b9fe8c..ec42eaa 100644
@@ -6437,14 +6437,8 @@ static int select_idle_sibling(struct task_struct *p, int prev, int 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) &&
-	    asym_fits_capacity(task_util, recent_used_cpu)) {
-		/*

kernel/sched/fair.c static int select_idle_sibling(struct task_struct *p, int prev, int target) · line 6444

Quoted 10 lines
kernel/sched/fair.c +1 -5
-		 * Replace recent_used_cpu with prev as it is a potential
-		 * candidate for the next wake:
-		 */
-		p->recent_used_cpu = prev;
+	    asym_fits_capacity(task_util, recent_used_cpu))
 		return recent_used_cpu;
-	}
 
 	/*
 	 * For asymmetric CPU capacity systems, our domain of interest is

Looks like this has been already fixed in:

https://lore.kernel.org/r/[email protected]