]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched: extend sync wakeups
authorAndrew Morton <akpm@osdl.org>
Mon, 10 May 2004 06:28:20 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 10 May 2004 06:28:20 +0000 (23:28 -0700)
From: Ingo Molnar <mingo@elte.hu>

The attached patch extends sync wakeups to the process sys_exit() path too:
the chldwait wakeup can be done sync, since we know that the process is
going to exit (and thus deschedule).

The most visible effect of this change is strace's behavior on SMP systems:
it now stays on a single CPU, together with the traced child.  (previously
it would run in parallel to the child, bouncing around madly.)

kernel/signal.c

index a9181552a76e0e6c26a3255f605a6467163a06e0..7d582211959e2f63e529cbb1d5ad95eafb8eb6e6 100644 (file)
@@ -1403,12 +1403,12 @@ static void __wake_up_parent(struct task_struct *p,
         * Fortunately this is not necessary for thread groups:
         */
        if (p->tgid == tsk->tgid) {
-               wake_up_interruptible(&tsk->wait_chldexit);
+               wake_up_interruptible_sync(&tsk->wait_chldexit);
                return;
        }
 
        do {
-               wake_up_interruptible(&tsk->wait_chldexit);
+               wake_up_interruptible_sync(&tsk->wait_chldexit);
                tsk = next_thread(tsk);
                if (tsk->signal != parent->signal)
                        BUG();