diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-04-30 03:52:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:33 -0400 |
commit | bfc4b0890af566940de6e7aeb4b5faf46d3c3513 (patch) | |
tree | d3c0d7ad6e3d619345acf7130f053514177bf5c7 /kernel | |
parent | 573cf9ad72c13750e86c91de43477e9dfb440523 (diff) |
signals: do_group_exit(): use signal_group_exit() more consistently
do_group_exit() checks SIGNAL_GROUP_EXIT to avoid taking sighand->siglock.
Since ed5d2cac114202fe2978a9cbcab8f5032796d538 exec() doesn't set this
flag, we should use signal_group_exit().
This is not needed for correctness, but can speedup the multithreaded exec
and makes the code more consistent.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index ae0f2c4e452..6d019aa8522 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1115,12 +1115,13 @@ asmlinkage long sys_exit(int error_code) | |||
1115 | NORET_TYPE void | 1115 | NORET_TYPE void |
1116 | do_group_exit(int exit_code) | 1116 | do_group_exit(int exit_code) |
1117 | { | 1117 | { |
1118 | struct signal_struct *sig = current->signal; | ||
1119 | |||
1118 | BUG_ON(exit_code & 0x80); /* core dumps don't get here */ | 1120 | BUG_ON(exit_code & 0x80); /* core dumps don't get here */ |
1119 | 1121 | ||
1120 | if (current->signal->flags & SIGNAL_GROUP_EXIT) | 1122 | if (signal_group_exit(sig)) |
1121 | exit_code = current->signal->group_exit_code; | 1123 | exit_code = sig->group_exit_code; |
1122 | else if (!thread_group_empty(current)) { | 1124 | else if (!thread_group_empty(current)) { |
1123 | struct signal_struct *const sig = current->signal; | ||
1124 | struct sighand_struct *const sighand = current->sighand; | 1125 | struct sighand_struct *const sighand = current->sighand; |
1125 | spin_lock_irq(&sighand->siglock); | 1126 | spin_lock_irq(&sighand->siglock); |
1126 | if (signal_group_exit(sig)) | 1127 | if (signal_group_exit(sig)) |