diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-01-25 10:08:40 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:19:07 (GMT) |
commit | ea408e3da40df36ea828ac753c3d2978722d8dfa (patch) | |
tree | 2c993f73a6d3877ee1692cbd3c6706a8b0340f0a /fs | |
parent | 026ba355cd0372630c9266141a7ab45af1075020 (diff) | |
download | linux-fsl-qoriq-ea408e3da40df36ea828ac753c3d2978722d8dfa.tar.xz |
timer-fd: Prevent live lock
If hrtimer_try_to_cancel() requires a retry, then depending on the
priority setting te retry loop might prevent timer callback completion
on RT. Prevent that by waiting for completion on RT, no change for a
non RT kernel.
Reported-by: Sankara Muthukrishnan <sankara.m@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Diffstat (limited to 'fs')
-rw-r--r-- | fs/timerfd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c index 9293121..d20e45a 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -380,7 +380,10 @@ static int do_timerfd_settime(int ufd, int flags, break; } spin_unlock_irq(&ctx->wqh.lock); - cpu_relax(); + if (isalarm(ctx)) + hrtimer_wait_for_timer(&ctx->t.alarm.timer); + else + hrtimer_wait_for_timer(&ctx->t.tmr); } /* |