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: Oleg Nesterov <[email protected]>
--- 25/kernel/fork.c~4_CURR_TASK 2008-02-17 23:40:09.000000000 +0300
+++ 25/kernel/fork.c 2008-03-07 14:50:52.000000000 +0300
@@ -902,7 +902,7 @@ static int copy_signal(unsigned long clo
sig->group_exit_code = 0;
sig->group_exit_task = NULL;
sig->group_stop_count = 0;
- sig->curr_target = NULL;
+ sig->curr_target = tsk;
init_sigpending(&sig->shared_pending);
INIT_LIST_HEAD(&sig->posix_timers);
--- 25/kernel/signal.c~4_CURR_TASK 2008-03-07 13:59:09.000000000 +0300
+++ 25/kernel/signal.c 2008-03-07 14:51:58.000000000 +0300
@@ -863,10 +863,6 @@ __group_complete_signal(int sig, struct
* Otherwise try to find a suitable thread.
*/
t = signal->curr_target;
- if (t == NULL)
- /* restart balancing at this thread */
- t = signal->curr_target = p;
-
while (!wants_signal(sig, t)) {
t = next_thread(t);
if (t == signal->curr_target)
> Suggested by Roland McGrath.
Yes it was, and a good change too! :-)
Thanks,
Roland