summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/time/tick-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 5edfb4806032..edd45f64162f 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -243,8 +243,13 @@ static bool tick_check_preferred(struct clock_event_device *curdev,
return false;
}
- /* Use the higher rated one */
- return !curdev || newdev->rating > curdev->rating;
+ /*
+ * Use the higher rated one, but prefer a CPU local device with a lower
+ * rating than a non-CPU local device
+ */
+ return !curdev ||
+ newdev->rating > curdev->rating ||
+ !cpumask_equal(curdev->cpumask, newdev->cpumask);
}
/*