aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2015-06-11 08:46:44 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-06-18 18:09:56 -0400
commitc04dca02bc73096435a5c36efd5ccb2171edcbe1 (patch)
tree6875551d63882ac926b68a964c9629f45d0c4f7d /kernel
parent51a16c1e887a5975ada27a3ae935a4f2783005da (diff)
hrtimer: Remove HRTIMER_STATE_MIGRATE
I do not understand HRTIMER_STATE_MIGRATE. Unless I am totally confused it looks buggy and simply unneeded. migrate_hrtimer_list() sets it to keep hrtimer_active() == T, but this is not enough: this can fool, say, hrtimer_is_queued() in dequeue_signal(). Can't migrate_hrtimer_list() simply use HRTIMER_STATE_ENQUEUED? This fixes the race and we can kill STATE_MIGRATE. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: ktkhai@parallels.com Cc: rostedt@goodmis.org Cc: juri.lelli@gmail.com Cc: pang.xunlei@linaro.org Cc: wanpeng.li@linux.intel.com Cc: umgwanakikbuti@gmail.com Link: http://lkml.kernel.org/r/20150611124743.072387650@infradead.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/hrtimer.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 278d4b36fd94..b1b795e5e0b1 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1508,11 +1508,11 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
1508 debug_deactivate(timer); 1508 debug_deactivate(timer);
1509 1509
1510 /* 1510 /*
1511 * Mark it as STATE_MIGRATE not INACTIVE otherwise the 1511 * Mark it as ENQUEUED not INACTIVE otherwise the
1512 * timer could be seen as !active and just vanish away 1512 * timer could be seen as !active and just vanish away
1513 * under us on another CPU 1513 * under us on another CPU
1514 */ 1514 */
1515 __remove_hrtimer(timer, old_base, HRTIMER_STATE_MIGRATE, 0); 1515 __remove_hrtimer(timer, old_base, HRTIMER_STATE_ENQUEUED, 0);
1516 timer->base = new_base; 1516 timer->base = new_base;
1517 /* 1517 /*
1518 * Enqueue the timers on the new cpu. This does not 1518 * Enqueue the timers on the new cpu. This does not
@@ -1523,9 +1523,6 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
1523 * event device. 1523 * event device.
1524 */ 1524 */
1525 enqueue_hrtimer(timer, new_base); 1525 enqueue_hrtimer(timer, new_base);
1526
1527 /* Clear the migration state bit */
1528 timer->state &= ~HRTIMER_STATE_MIGRATE;
1529 } 1526 }
1530} 1527}
1531 1528