linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AW: Thread group exit
@ 2002-08-05 10:10 Zeuner, Axel
  0 siblings, 0 replies; 2+ messages in thread
From: Zeuner, Axel @ 2002-08-05 10:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

> On Mon, 2002-08-05 at 09:58, Zeuner, Axel wrote:
> > I would expect, that changes of the parent of one member of 
> the thread group
> > do not affect the interactions between the members of the group. 
> > Corrections are welcome.
> 
> I agree with your diagnosis I'm not convinced by your change. 
> The thread
> groups are only used by NGPT not by glibc pthreads while the 
> problem is
> true across both.
> 
> Possibly the right fix is to remove the reparent to init increment of
> self_exec_id and instead explicitly check process 1 in the 
> signal paths.
> 
> Opinions ?
The idea not to change the self_exec_id seems to be the more general 
solution: less work in the loop in the forget_original_parent function 
and only changes in do_notify_parent kernel/signal.c are required:
One could check for tsk->p_pptr/parent == child_reaper and force a SIGCHLD
in this case. Changes in the self_exec_id because of exec's are 
catched by the code in exit_notify already.
The difference between self_exec_id and parent_exec_id would become 
a real exec counter.

Axel

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

* AW: Thread group exit
@ 2002-08-05 11:06 Zeuner, Axel
  0 siblings, 0 replies; 2+ messages in thread
From: Zeuner, Axel @ 2002-08-05 11:06 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

I rewrote the patch according to Alans idea, works for me. As mentioned
before, the patch is against 2.4.18-ngpt, but should also apply to 2.4.19.
Replace p_pptr with parent for 2.5 series.

Axel

Dr. Axel Zeuner
Consultant e.business D
Systor GmbH & Co. KG, Goethering 58,  63067 Offenbach


[-- Attachment #2: self_exec_id.diff --]
[-- Type: application/octet-stream, Size: 773 bytes --]

--- kernel/exit.c.original	Mon Aug  5 09:09:31 2002
+++ kernel/exit.c	Mon Aug  5 12:26:38 2002
@@ -176,7 +176,6 @@
 		if (p->p_opptr == father) {
 			/* We dont want people slaying init */
 			p->exit_signal = SIGCHLD;
-			p->self_exec_id++;
 
 			/* Make sure we're not reparenting to ourselves */
 			if (p == reaper)
--- kernel/signal.c.original	Mon Aug  5 12:26:49 2002
+++ kernel/signal.c	Mon Aug  5 12:34:44 2002
@@ -16,6 +16,8 @@
 
 #include <asm/uaccess.h>
 
+extern struct task_struct* child_reaper;
+
 /*
  * SLAB caches for signal bits.
  */
@@ -772,6 +774,9 @@
 	struct siginfo info;
 	int why, status;
 
+	if (tsk->p_pptr==child_reaper) {
+		sig=SIGCHLD;
+	}
 	info.si_signo = sig;
 	info.si_errno = 0;
 	info.si_pid = tsk->pid;

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

end of thread, other threads:[~2002-08-05 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-05 10:10 AW: Thread group exit Zeuner, Axel
2002-08-05 11:06 Zeuner, Axel

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