Commit a8194b4e authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] exit-thread-2.5.34-A0, BK-curr

This optimizes sys_exit_group() to only take the siglock if it's a true
thread group.  Boots & works fine.
parent 292c2c8d
......@@ -681,21 +681,25 @@ asmlinkage long sys_exit(int error_code)
*/
asmlinkage long sys_exit_group(int error_code)
{
struct signal_struct *sig = current->sig;
unsigned int exit_code = (error_code & 0xff) << 8;
spin_lock_irq(&sig->siglock);
if (sig->group_exit) {
spin_unlock_irq(&sig->siglock);
if (!list_empty(&current->thread_group)) {
struct signal_struct *sig = current->sig;
spin_lock_irq(&sig->siglock);
if (sig->group_exit) {
spin_unlock_irq(&sig->siglock);
/* another thread was faster: */
do_exit(sig->group_exit_code);
/* another thread was faster: */
do_exit(sig->group_exit_code);
}
sig->group_exit = 1;
sig->group_exit_code = exit_code;
__broadcast_thread_group(current, SIGKILL);
spin_unlock_irq(&sig->siglock);
}
sig->group_exit = 1;
sig->group_exit_code = (error_code & 0xff) << 8;
__broadcast_thread_group(current, SIGKILL);
spin_unlock_irq(&sig->siglock);
do_exit(sig->group_exit_code);
do_exit(exit_code);
}
static int eligible_child(pid_t pid, int options, task_t *p)
......
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