aboutsummaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time')
-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 e91f1019d66..086216c433f 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -234,8 +234,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);
}
/*