mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] posix-timers: remove idr_lock
@ 2011-06-10 20:13 Andi Kleen
  2011-06-10 20:13 ` [PATCH 2/3] posix-timers: move global timer id management to signal_struct Andi Kleen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andi Kleen @ 2011-06-10 20:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: eric.dumazet, tglx, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

idr_lock is only used to protect the global posix_timers idr,
but idr does its own locking (or RCUing) anyways and doesn't
need it. So remove it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 kernel/posix-timers.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 4556182..a6dcc10 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -71,7 +71,6 @@
  */
 static struct kmem_cache *posix_timers_cache;
 static struct idr posix_timers_id;
-static DEFINE_SPINLOCK(idr_lock);
 
 /*
  * we assume that the new SIGEV_THREAD_ID shares no bits with the other
@@ -502,12 +501,8 @@ static void k_itimer_rcu_free(struct rcu_head *head)
 #define IT_ID_NOT_SET	0
 static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
 {
-	if (it_id_set) {
-		unsigned long flags;
-		spin_lock_irqsave(&idr_lock, flags);
+	if (it_id_set)
 		idr_remove(&posix_timers_id, tmr->it_id);
-		spin_unlock_irqrestore(&idr_lock, flags);
-	}
 	put_pid(tmr->it_pid);
 	sigqueue_free(tmr->sigq);
 	call_rcu(&tmr->it.rcu, k_itimer_rcu_free);
@@ -557,9 +552,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
 		error = -EAGAIN;
 		goto out;
 	}
-	spin_lock_irq(&idr_lock);
 	error = idr_get_new(&posix_timers_id, new_timer, &new_timer_id);
-	spin_unlock_irq(&idr_lock);
 	if (error) {
 		if (error == -EAGAIN)
 			goto retry;
-- 
1.7.4.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-10 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-10 20:13 [PATCH 1/3] posix-timers: remove idr_lock Andi Kleen
2011-06-10 20:13 ` [PATCH 2/3] posix-timers: move global timer id management to signal_struct Andi Kleen
2011-06-10 20:13 ` [PATCH 3/3] posix-timers: limit the number of posix timers per process Andi Kleen
2011-06-10 20:40 ` [PATCH 1/3] posix-timers: remove idr_lock Eric Dumazet
2011-06-10 20:44   ` Andi Kleen
2011-06-10 20:52     ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®