sched/tick: Ensure timers does not get queued on isolated cpus

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>
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 9e207e3..7511544 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -240,7 +240,15 @@
 #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; }
@@ -278,7 +286,7 @@
 	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)