diff options
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 9002958a96e7..126b9808f287 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -206,8 +206,19 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, | |||
206 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 206 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |
207 | if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) { | 207 | if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) { |
208 | preferred_cpu = get_nohz_load_balancer(); | 208 | preferred_cpu = get_nohz_load_balancer(); |
209 | if (preferred_cpu >= 0) | 209 | if (preferred_cpu >= 0) { |
210 | cpu = preferred_cpu; | 210 | /* |
211 | * We must not check the expiry value when | ||
212 | * preferred_cpu is the current cpu. If base | ||
213 | * != new_base we would loop forever when the | ||
214 | * timer expires before the current programmed | ||
215 | * next timer event. | ||
216 | */ | ||
217 | if (preferred_cpu != cpu) | ||
218 | cpu = preferred_cpu; | ||
219 | else | ||
220 | preferred_cpu = -1; | ||
221 | } | ||
211 | } | 222 | } |
212 | #endif | 223 | #endif |
213 | 224 | ||