[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a125ecc16453a4fe0ba865c7df87b9c722991fdf@git.kernel.org>
Date: Thu, 1 Aug 2019 12:07:00 -0700
From: tip-bot for Anna-Maria Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, tglx@...utronix.de, bigeasy@...utronix.de,
anna-maria@...utronix.de, hpa@...or.com,
linux-kernel@...r.kernel.org, mingo@...nel.org
Subject: [tip:timers/core] timerfd: Prepare for PREEMPT_RT
Commit-ID: a125ecc16453a4fe0ba865c7df87b9c722991fdf
Gitweb: https://git.kernel.org/tip/a125ecc16453a4fe0ba865c7df87b9c722991fdf
Author: Anna-Maria Gleixner <anna-maria@...utronix.de>
AuthorDate: Wed, 31 Jul 2019 00:33:50 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 1 Aug 2019 20:51:23 +0200
timerfd: Prepare for PREEMPT_RT
Use the hrtimer_cancel_wait_running() synchronization mechanism to prevent
priority inversion and live locks on PREEMPT_RT.
[ tglx: Split out of combo patch ]
Signed-off-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lkml.kernel.org/r/20190730223828.600085866@linutronix.de
---
fs/timerfd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 6a6fc8aa1de7..48305ba41e3c 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -471,7 +471,11 @@ static int do_timerfd_settime(int ufd, int flags,
break;
}
spin_unlock_irq(&ctx->wqh.lock);
- cpu_relax();
+
+ if (isalarm(ctx))
+ hrtimer_cancel_wait_running(&ctx->t.alarm.timer);
+ else
+ hrtimer_cancel_wait_running(&ctx->t.tmr);
}
/*
Powered by blists - more mailing lists