Commit db51aecc authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

signals: microoptimize the usage of ->curr_target

Suggested by Roland McGrath.

Initialize signal->curr_target in copy_signal().  This way ->curr_target is
never == NULL, we can kill the check in __group_complete_signal's hot path.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 08d2c30c
...@@ -892,7 +892,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) ...@@ -892,7 +892,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
sig->group_exit_code = 0; sig->group_exit_code = 0;
sig->group_exit_task = NULL; sig->group_exit_task = NULL;
sig->group_stop_count = 0; sig->group_stop_count = 0;
sig->curr_target = NULL; sig->curr_target = tsk;
init_sigpending(&sig->shared_pending); init_sigpending(&sig->shared_pending);
INIT_LIST_HEAD(&sig->posix_timers); INIT_LIST_HEAD(&sig->posix_timers);
......
...@@ -863,10 +863,6 @@ __group_complete_signal(int sig, struct task_struct *p) ...@@ -863,10 +863,6 @@ __group_complete_signal(int sig, struct task_struct *p)
* Otherwise try to find a suitable thread. * Otherwise try to find a suitable thread.
*/ */
t = signal->curr_target; t = signal->curr_target;
if (t == NULL)
/* restart balancing at this thread */
t = signal->curr_target = p;
while (!wants_signal(sig, t)) { while (!wants_signal(sig, t)) {
t = next_thread(t); t = next_thread(t);
if (t == signal->curr_target) if (t == signal->curr_target)
......
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