public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 8139too: defunct threads
@ 2001-04-12 17:58 Rod Stewart
  2001-04-12 18:54 ` Andrew Morton
  2001-04-12 22:19 ` David Woodhouse
  0 siblings, 2 replies; 14+ messages in thread
From: Rod Stewart @ 2001-04-12 17:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jeff Garzik


Hello,

Using the 8139too driver, 0.9.15c, we have noticed that we get a defunct
thread for each device we have; if the driver is built into the kernel.
If the driver is built as a module, no defunct threads appear.

This has happened with any 2.4 kernel we've used, up to and including
2.4.3.

Below is the output from a custom board (but the problem also shows up
with a standard PCI card with RTL-8139B) with three RealTek RTL8139
chipsets on it.

[root@stewart-nw34 /root]# ps uaxwwww|grep eth
root        14  0.0  0.0     0    0 ?  Z    13:39   0:00 [eth0  <defunct>]
root        15  0.0  0.0     0    0 ?  Z    13:39   0:00 [eth1  <defunct>]
root        16  0.0  0.0     0    0 ?  Z    13:39   0:00 [eth2  <defunct>]
root       240  0.0  0.0     0    0 ?        SW   13:39   0:00 [eth0]
root       572  0.0  0.0     0    0 pts/1    SW   13:49   0:00 [eth1]
root       538  0.0  0.4  1216  460 pts/0    S    13:41   0:00 grep eth

8139too Fast Ethernet driver 0.9.15c loaded
PCI: Enabling device 00:05.0 (0000 -> 0003)
PCI: Assigned IRQ 6 for device 00:05.0
PCI: Setting latency timer of device 00:05.0 to 64
eth0: RealTek RTL8139 Fast Ethernet at 0xc7800000, 00:10:57:01:00:19,
	IRQ 6
eth0:  Identified 8139 chip type 'RTL-8139C'
PCI: Enabling device 00:09.0 (0000 -> 0003)
PCI: Assigned IRQ 6 for device 00:09.0
PCI: Setting latency timer of device 00:09.0 to 64
eth1: RealTek RTL8139 Fast Ethernet at 0xc7802100, 00:10:57:02:00:19,
	IRQ 6
eth1:  Identified 8139 chip type 'RTL-8139C'
PCI: Enabling device 00:0a.0 (0000 -> 0003)
PCI: Assigned IRQ 6 for device 00:0a.0
PCI: Setting latency timer of device 00:0a.0 to 64
eth2: RealTek RTL8139 Fast Ethernet at 0xc7804200, 00:10:57:03:00:19,
	IRQ 6
eth2:  Identified 8139 chip type 'RTL-8139C'


I'm not certain if this is supposed to be expected behaviour or not, if it
is we'll tell QA to ignore it.

Thanks,
-Rms


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: 8139too: defunct threads
@ 2001-04-14 14:00 Manfred Spraul
  2001-04-14 16:21 ` Rod Stewart
  0 siblings, 1 reply; 14+ 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] 14+ messages in thread

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-12 17:58 8139too: defunct threads Rod Stewart
2001-04-12 18:54 ` Andrew Morton
2001-04-12 19:32   ` Alan Cox
2001-04-12 20:18     ` Andrew Morton
2001-04-12 21:15       ` Alan Cox
2001-04-12 19:37   ` Rod Stewart
2001-04-12 20:38     ` Andrew Morton
2001-04-12 21:23       ` Rod Stewart
2001-04-12 21:30         ` Andrew Morton
2001-04-12 21:33           ` Rod Stewart
2001-04-13 20:16       ` Rod Stewart
2001-04-12 22:19 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2001-04-14 14:00 Manfred Spraul
2001-04-14 16:21 ` Rod Stewart

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