Commit 9465bee8 authored by Linus Torvalds's avatar Linus Torvalds

Revert "Fix cpu timers exit deadlock and races"

Revert commit e03d13e9, to be replaced
by a much nicer fix from Roland.
parent 0213df74
...@@ -387,19 +387,25 @@ int posix_cpu_timer_del(struct k_itimer *timer) ...@@ -387,19 +387,25 @@ int posix_cpu_timer_del(struct k_itimer *timer)
if (unlikely(p == NULL)) if (unlikely(p == NULL))
return 0; return 0;
spin_lock(&p->sighand->siglock);
if (!list_empty(&timer->it.cpu.entry)) { if (!list_empty(&timer->it.cpu.entry)) {
read_lock(&tasklist_lock);
if (unlikely(p->signal == NULL)) {
/* /*
* Take us off the task's timer list. We don't need to * We raced with the reaping of the task.
* take tasklist_lock and check for the task being reaped. * The deletion should have cleared us off the list.
* If it was reaped, it already called posix_cpu_timers_exit
* and posix_cpu_timers_exit_group to clear all the timers
* that pointed to it.
*/ */
BUG_ON(!list_empty(&timer->it.cpu.entry));
} else {
/*
* Take us off the task's timer list.
*/
spin_lock(&p->sighand->siglock);
list_del(&timer->it.cpu.entry); list_del(&timer->it.cpu.entry);
put_task_struct(p);
}
spin_unlock(&p->sighand->siglock); spin_unlock(&p->sighand->siglock);
}
read_unlock(&tasklist_lock);
}
put_task_struct(p);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment