[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-7586addb99322faf4d096fc8beb140f879409212@git.kernel.org>
Date: Sat, 22 Jun 2019 12:31:14 -0700
From: tip-bot for Sebastian Andrzej Siewior <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
bigeasy@...utronix.de, hpa@...or.com, tglx@...utronix.de
Subject: [tip:timers/core] posix-timers: Use spin_lock_irq() in
itimer_delete()
Commit-ID: 7586addb99322faf4d096fc8beb140f879409212
Gitweb: https://git.kernel.org/tip/7586addb99322faf4d096fc8beb140f879409212
Author: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
AuthorDate: Fri, 21 Jun 2019 16:36:43 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sat, 22 Jun 2019 12:14:22 +0200
posix-timers: Use spin_lock_irq() in itimer_delete()
itimer_delete() uses spin_lock_irqsave() to obtain a `flags' variable
which can then be passed to unlock_timer(). It uses already spin_lock
locking for the structure instead of lock_timer() because it has a timer
which can not be removed by others at this point. The cleanup is always
performed with enabled interrupts.
Use spin_lock_irq() / spin_unlock_irq() so the `flags' variable can be
removed.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lkml.kernel.org/r/20190621143643.25649-3-bigeasy@linutronix.de
---
kernel/time/posix-timers.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index caa63e58e3d8..d7f2d91acdac 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -980,18 +980,16 @@ retry_delete:
*/
static void itimer_delete(struct k_itimer *timer)
{
- unsigned long flags;
-
retry_delete:
- spin_lock_irqsave(&timer->it_lock, flags);
+ spin_lock_irq(&timer->it_lock);
if (timer_delete_hook(timer) == TIMER_RETRY) {
- unlock_timer(timer, flags);
+ spin_unlock_irq(&timer->it_lock);
goto retry_delete;
}
list_del(&timer->list);
- unlock_timer(timer, flags);
+ spin_unlock_irq(&timer->it_lock);
release_posix_timer(timer, IT_ID_SET);
}
Powered by blists - more mailing lists