diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-04-30 03:52:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:35 -0400 |
commit | f8c5b5c06f63fe9aaebefbf9f0b79909066b1b6c (patch) | |
tree | 58f7cde6d5b6c52ad927658521a32822661f048d | |
parent | 5fc894bb4fb1de8373d1d5fb6db19204a16859e8 (diff) |
signals: __group_complete_signal: cache the value of p->signal
Cosmetic, cache p->signal to make the code a bit more readable.
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>
-rw-r--r-- | kernel/signal.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 8259262eaa60..2a06f2441805 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -842,6 +842,7 @@ static inline int wants_signal(int sig, struct task_struct *p) | |||
842 | static void | 842 | static void |
843 | __group_complete_signal(int sig, struct task_struct *p) | 843 | __group_complete_signal(int sig, struct task_struct *p) |
844 | { | 844 | { |
845 | struct signal_struct *signal = p->signal; | ||
845 | struct task_struct *t; | 846 | struct task_struct *t; |
846 | 847 | ||
847 | /* | 848 | /* |
@@ -862,14 +863,14 @@ __group_complete_signal(int sig, struct task_struct *p) | |||
862 | /* | 863 | /* |
863 | * Otherwise try to find a suitable thread. | 864 | * Otherwise try to find a suitable thread. |
864 | */ | 865 | */ |
865 | t = p->signal->curr_target; | 866 | t = signal->curr_target; |
866 | if (t == NULL) | 867 | if (t == NULL) |
867 | /* restart balancing at this thread */ | 868 | /* restart balancing at this thread */ |
868 | t = p->signal->curr_target = p; | 869 | t = signal->curr_target = p; |
869 | 870 | ||
870 | while (!wants_signal(sig, t)) { | 871 | while (!wants_signal(sig, t)) { |
871 | t = next_thread(t); | 872 | t = next_thread(t); |
872 | if (t == p->signal->curr_target) | 873 | if (t == signal->curr_target) |
873 | /* | 874 | /* |
874 | * No thread needs to be woken. | 875 | * No thread needs to be woken. |
875 | * Any eligible threads will see | 876 | * Any eligible threads will see |
@@ -877,14 +878,14 @@ __group_complete_signal(int sig, struct task_struct *p) | |||
877 | */ | 878 | */ |
878 | return; | 879 | return; |
879 | } | 880 | } |
880 | p->signal->curr_target = t; | 881 | signal->curr_target = t; |
881 | } | 882 | } |
882 | 883 | ||
883 | /* | 884 | /* |
884 | * Found a killable thread. If the signal will be fatal, | 885 | * Found a killable thread. If the signal will be fatal, |
885 | * then start taking the whole group down immediately. | 886 | * then start taking the whole group down immediately. |
886 | */ | 887 | */ |
887 | if (sig_fatal(p, sig) && !(p->signal->flags & SIGNAL_GROUP_EXIT) && | 888 | if (sig_fatal(p, sig) && !(signal->flags & SIGNAL_GROUP_EXIT) && |
888 | !sigismember(&t->real_blocked, sig) && | 889 | !sigismember(&t->real_blocked, sig) && |
889 | (sig == SIGKILL || !(t->ptrace & PT_PTRACED))) { | 890 | (sig == SIGKILL || !(t->ptrace & PT_PTRACED))) { |
890 | /* | 891 | /* |
@@ -897,9 +898,9 @@ __group_complete_signal(int sig, struct task_struct *p) | |||
897 | * running and doing things after a slower | 898 | * running and doing things after a slower |
898 | * thread has the fatal signal pending. | 899 | * thread has the fatal signal pending. |
899 | */ | 900 | */ |
900 | p->signal->flags = SIGNAL_GROUP_EXIT; | 901 | signal->flags = SIGNAL_GROUP_EXIT; |
901 | p->signal->group_exit_code = sig; | 902 | signal->group_exit_code = sig; |
902 | p->signal->group_stop_count = 0; | 903 | signal->group_stop_count = 0; |
903 | t = p; | 904 | t = p; |
904 | do { | 905 | do { |
905 | sigaddset(&t->pending.signal, SIGKILL); | 906 | sigaddset(&t->pending.signal, SIGKILL); |