OSDN Git Service

sched/tick: Ensure timers does not get queued on isolated cpus
authorOlav Haugan <ohaugan@codeaurora.org>
Thu, 2 Jun 2016 23:29:27 +0000 (16:29 -0700)
committerOlav Haugan <ohaugan@codeaurora.org>
Sat, 24 Sep 2016 18:00:00 +0000 (11:00 -0700)
Timers should not be queued on isolated cpus. Instead try to find
other cpus to queue timer on.

Change-Id: I5d849dfd29aa5bb594454473768d7db1da258028
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
include/linux/tick.h

index 5bf3dda..1732697 100644 (file)
@@ -161,7 +161,15 @@ extern void __tick_nohz_task_switch(void);
 #else
 static inline int housekeeping_any_cpu(void)
 {
-       return smp_processor_id();
+       cpumask_t available;
+       int cpu;
+
+       cpumask_andnot(&available, cpu_online_mask, cpu_isolated_mask);
+       cpu = cpumask_any(&available);
+       if (cpu >= nr_cpu_ids)
+               cpu = smp_processor_id();
+
+       return cpu;
 }
 static inline bool tick_nohz_full_enabled(void) { return false; }
 static inline bool tick_nohz_full_cpu(int cpu) { return false; }
@@ -187,7 +195,7 @@ static inline bool is_housekeeping_cpu(int cpu)
        if (tick_nohz_full_enabled())
                return cpumask_test_cpu(cpu, housekeeping_mask);
 #endif
-       return true;
+       return !cpu_isolated(cpu);
 }
 
 static inline void housekeeping_affine(struct task_struct *t)