git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'sched-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip
[pandora-kernel.git]
/
kernel
/
posix-timers.c
diff --git
a/kernel/posix-timers.c
b/kernel/posix-timers.c
index
e5498d7
..
4556182
100644
(file)
--- a/
kernel/posix-timers.c
+++ b/
kernel/posix-timers.c
@@
-491,6
+491,13
@@
static struct k_itimer * alloc_posix_timer(void)
return tmr;
}
return tmr;
}
+static void k_itimer_rcu_free(struct rcu_head *head)
+{
+ struct k_itimer *tmr = container_of(head, struct k_itimer, it.rcu);
+
+ kmem_cache_free(posix_timers_cache, tmr);
+}
+
#define IT_ID_SET 1
#define IT_ID_NOT_SET 0
static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
#define IT_ID_SET 1
#define IT_ID_NOT_SET 0
static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
@@
-503,7
+510,7
@@
static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
}
put_pid(tmr->it_pid);
sigqueue_free(tmr->sigq);
}
put_pid(tmr->it_pid);
sigqueue_free(tmr->sigq);
-
kmem_cache_free(posix_timers_cache, tmr
);
+
call_rcu(&tmr->it.rcu, k_itimer_rcu_free
);
}
static struct k_clock *clockid_to_kclock(const clockid_t id)
}
static struct k_clock *clockid_to_kclock(const clockid_t id)
@@
-631,22
+638,18
@@
out:
static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags)
{
struct k_itimer *timr;
static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags)
{
struct k_itimer *timr;
- /*
- * Watch out here. We do a irqsave on the idr_lock and pass the
- * flags part over to the timer lock. Must not let interrupts in
- * while we are moving the lock.
- */
- spin_lock_irqsave(&idr_lock, *flags);
+
+ rcu_read_lock();
timr = idr_find(&posix_timers_id, (int)timer_id);
if (timr) {
timr = idr_find(&posix_timers_id, (int)timer_id);
if (timr) {
- spin_lock
(&timr->it_lock
);
+ spin_lock
_irqsave(&timr->it_lock, *flags
);
if (timr->it_signal == current->signal) {
if (timr->it_signal == current->signal) {
-
spin_unlock(&idr_lock
);
+
rcu_read_unlock(
);
return timr;
}
return timr;
}
- spin_unlock
(&timr->it_lock
);
+ spin_unlock
_irqrestore(&timr->it_lock, *flags
);
}
}
-
spin_unlock_irqrestore(&idr_lock, *flags
);
+
rcu_read_unlock(
);
return NULL;
}
return NULL;
}
@@
-1056,7
+1059,7
@@
SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
*/
long clock_nanosleep_restart(struct restart_block *restart_block)
{
*/
long clock_nanosleep_restart(struct restart_block *restart_block)
{
- clockid_t which_clock = restart_block->nanosleep.
index
;
+ clockid_t which_clock = restart_block->nanosleep.
clockid
;
struct k_clock *kc = clockid_to_kclock(which_clock);
if (WARN_ON_ONCE(!kc || !kc->nsleep_restart))
struct k_clock *kc = clockid_to_kclock(which_clock);
if (WARN_ON_ONCE(!kc || !kc->nsleep_restart))