LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] signals: microoptimize the usage of ->curr_target
@ 2008-03-07 11:57 Oleg Nesterov
  2008-03-07 19:01 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2008-03-07 11:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Roland McGrath, linux-kernel

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 <oleg@tv-sign.ru>

--- 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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] signals: microoptimize the usage of ->curr_target
  2008-03-07 11:57 [PATCH] signals: microoptimize the usage of ->curr_target Oleg Nesterov
@ 2008-03-07 19:01 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2008-03-07 19:01 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel

> Suggested by Roland McGrath.

Yes it was, and a good change too!  :-)


Thanks,
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-07 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-07 11:57 [PATCH] signals: microoptimize the usage of ->curr_target Oleg Nesterov
2008-03-07 19:01 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).