[PATCH] bad position of "wake_up_process()" in arch/i386/kernel/ptrace.c

Eric PAIRE (e.paire@opengroup.org)
Fri, 11 Sep 1998 07:57:51 +0200


Here is an obvious fix in arch/i386/kernel/ptrace.c which moves the call to
"wake_up_process()" *AFTER* the status update of the awaken process is
complete (and not *BEFORE* as it is currently in 2.1.121), which is much
better on SMP hardware :-).

Best regards,
-Eric
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Eric PAIRE
Email : e.paire@gr.opengroup.org | THE Open GROUP - Grenoble Research Institute
Phone : +33 (0) 476 63 48 71 | 2, avenue de Vignate
Fax : +33 (0) 476 51 05 32 | F-38610 Gieres FRANCE
------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------
--- arch/i386/kernel/ptrace.c.OLD Thu Sep 10 08:00:17 1998
+++ arch/i386/kernel/ptrace.c Thu Sep 10 09:11:48 1998
@@ -507,10 +507,10 @@
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
- wake_up_process(child);
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
put_stack_long(child, EFL_OFFSET,tmp);
+ wake_up_process(child);
ret = 0;
goto out;
}
@@ -526,11 +526,11 @@
ret = 0;
if (child->state == TASK_ZOMBIE) /* already dead */
goto out;
- wake_up_process(child);
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
put_stack_long(child, EFL_OFFSET, tmp);
+ wake_up_process(child);
goto out;
}

@@ -543,9 +543,9 @@
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
put_stack_long(child, EFL_OFFSET, tmp);
- wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
+ wake_up_process(child);
ret = 0;
goto out;
}
@@ -558,16 +558,16 @@
if ((unsigned long) data > _NSIG)
goto out;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
- wake_up_process(child);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
SET_LINKS(child);
write_unlock_irqrestore(&tasklist_lock, flags);
- /* make sure the single step bit is not set. */
+ /* make sure the single step bit is not set. */
tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
put_stack_long(child, EFL_OFFSET, tmp);
+ wake_up_process(child);
ret = 0;
goto out;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html