Commit 9b34eb70 authored by Ingo Molnar's avatar Ingo Molnar

[PATCH] exit-fix-2.5.38-F0

From Andrew Morton.

There are a couple of places where we would enable interrupts while
write-holding the tasklist_lock ...  nasty.
parent 2ce067b0
...@@ -477,13 +477,15 @@ void wake_up_forked_process(task_t * p) ...@@ -477,13 +477,15 @@ void wake_up_forked_process(task_t * p)
*/ */
void sched_exit(task_t * p) void sched_exit(task_t * p)
{ {
local_irq_disable(); unsigned long flags;
local_irq_save(flags);
if (p->first_time_slice) { if (p->first_time_slice) {
p->parent->time_slice += p->time_slice; p->parent->time_slice += p->time_slice;
if (unlikely(p->parent->time_slice > MAX_TIMESLICE)) if (unlikely(p->parent->time_slice > MAX_TIMESLICE))
p->parent->time_slice = MAX_TIMESLICE; p->parent->time_slice = MAX_TIMESLICE;
} }
local_irq_enable(); local_irq_restore(flags);
/* /*
* If the child was a (relative-) CPU hog then decrease * If the child was a (relative-) CPU hog then decrease
* the sleep_avg of the parent as well. * the sleep_avg of the parent as well.
......
...@@ -1086,6 +1086,7 @@ kill_proc(pid_t pid, int sig, int priv) ...@@ -1086,6 +1086,7 @@ kill_proc(pid_t pid, int sig, int priv)
*/ */
static inline void wake_up_parent(struct task_struct *p) static inline void wake_up_parent(struct task_struct *p)
{ {
unsigned long flags;
struct task_struct *parent = p->parent, *tsk = parent; struct task_struct *parent = p->parent, *tsk = parent;
/* /*
...@@ -1095,14 +1096,14 @@ static inline void wake_up_parent(struct task_struct *p) ...@@ -1095,14 +1096,14 @@ static inline void wake_up_parent(struct task_struct *p)
wake_up_interruptible(&tsk->wait_chldexit); wake_up_interruptible(&tsk->wait_chldexit);
return; return;
} }
spin_lock_irq(&parent->sig->siglock); spin_lock_irqsave(&parent->sig->siglock, flags);
do { do {
wake_up_interruptible(&tsk->wait_chldexit); wake_up_interruptible(&tsk->wait_chldexit);
tsk = next_thread(tsk); tsk = next_thread(tsk);
if (tsk->sig != parent->sig) if (tsk->sig != parent->sig)
BUG(); BUG();
} while (tsk != parent); } while (tsk != parent);
spin_unlock_irq(&parent->sig->siglock); spin_unlock_irqrestore(&parent->sig->siglock, flags);
} }
/* /*
......
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