Skip to contentSkip to conversation

core.c : affine non-pinned timers.

RFC New Vatika Harlalka 1 participant 1 message Jun 2, 2015 Scheduler

lore
Share & tools
lore
#0 lore raw

RFC 1/1 core.c : affine non-pinned timers.

---
 kernel/sched/core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
kernel/sched/core.c +7 -1
index 57bd333..e2785e0 100644
@@ -599,7 +599,8 @@ int get_nohz_timer_target(int pinned)
 	int i;
 	struct sched_domain *sd;
 
-	if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu))
+	if (pinned || !get_sysctl_timer_migration() ||
+		(!idle_cpu(cpu) && is_housekeeping_cpu(cpu)))
 		return cpu;
 
 	rcu_read_lock();
@@ -611,6 +612,11 @@ int get_nohz_timer_target(int pinned)
 			}
 		}
 	}
+
+	rcu_read_unlock();
+	cpu = cpumask_any_and(houekeeping_mask, cpu_online_mask);
+	return cpu;
+
 unlock:
 	rcu_read_unlock();
 	return cpu;
Signature · 1 line
2.4.2