public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: 8139too: defunct threads
@ 2001-04-14 14:00 Manfred Spraul
  2001-04-14 16:21 ` Rod Stewart
  0 siblings, 1 reply; 12+ messages in thread
From: Manfred Spraul @ 2001-04-14 14:00 UTC (permalink / raw)
  To: stewart; +Cc: linux-kernel

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

>> Ah. Of course. All (or most) kernel initialisation is
>> done by PID 1. Search for "kernel_thread" in init/main.c
>>
>> So it seems that in your setup, process 1 is not reaping
>> children, which is why this hasn't been reported before.
>> Is there something unusual about your setup?

> I found the difference which causes this. If I build my kernel with
> IP_PNP (IP: kernel level autoconfiguration) support I get a defunt
> thread for each 8139too device. If I don't build with IP_PNP
> support I don't get any, defunct ethernet threads.

Does init(8) reap children that died before it was spawned? I assume
that the defunct tasks were there _before_ init was spawned.

Perhaps init() [in linux/init/main.c] should reap all defunct tasks
before the execve("/sbin/init").

I've attached an untested patch, could you try it?

--
    Manfred


[-- Attachment #2: patch-main.dat --]
[-- Type: application/octet-stream, Size: 423 bytes --]

--- main.c	Fri Mar 30 15:42:49 2001
+++ /pub/home/manfred/main.c	Sat Apr 14 15:56:26 2001
@@ -777,6 +777,13 @@
 
 	(void) dup(0);
 	(void) dup(0);
+
+	while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
+		;
+	spin_lock_irq(&current->sigmask_lock);
+	flush_signals(curtask);
+	recalc_sigpending(curtask);
+	spin_lock_irq(&current->sigmask_lock);
 	
 	/*
 	 * We try each of these until one succeeds.

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

end of thread, other threads:[~2001-04-16 20:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-14 14:00 8139too: defunct threads Manfred Spraul
2001-04-14 16:21 ` Rod Stewart
2001-04-14 17:33   ` [PATCH] " Manfred Spraul
2001-04-14 18:53     ` Alan Cox
2001-04-14 21:43       ` Manfred Spraul
2001-04-15  5:08         ` Rod Stewart
2001-04-15 13:06           ` [new PATCH] " Manfred Spraul
2001-04-15 22:01             ` Rod Stewart
2001-04-16 17:00             ` Andrew Morton
2001-04-16 19:42               ` John Fremlin
2001-04-16 19:59                 ` Andrew Morton
2001-04-14 23:29       ` [PATCH] " Andreas Ferber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox