From: Manfred Spraul <manfred@colorfullife.com>
To: alan@lxorguk.ukuu.org.uk
Cc: Rod Stewart <stewart@dystopia.lab43.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] Re: 8139too: defunct threads
Date: Sat, 14 Apr 2001 19:33:52 +0200 [thread overview]
Message-ID: <3AD88A00.DF54EC12@colorfullife.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0104141219450.11838-100000@dystopia.lab43.org>
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Hi Alan,
Rod's init version (from RH 7.0) doesn't reap children that died before
it was started. Is that an init bug or should the kernel reap them
before the execve?
The attached patch reaps all zombies before the execve("/sbin/init").
I also found a bug in kernel/context.c: it doesn't acquire the sigmask
spinlock around the call to recalc_sigpending.
Rod Stewart wrote:
>
> Yes, that fixes my problem. No more defunct eth? processes when IP_PNP is
> compiled in. With the fix you said to the patch; replacing curtask with
> current.
>
Fortunately you don't use SMP - spin_lock_irq();...;spin_lock_irq()
instead of spin_lock_irq();...;spin_unlock_irq();
--
Manfred
[-- Attachment #2: patch-child --]
[-- Type: text/plain, Size: 915 bytes --]
// $Header$
// Kernel Version:
// VERSION = 2
// PATCHLEVEL = 4
// SUBLEVEL = 3
// EXTRAVERSION = -ac3
--- 2.4/init/main.c Sat Apr 7 22:02:27 2001
+++ build-2.4/init/main.c Sat Apr 14 19:18:34 2001
@@ -883,6 +883,13 @@
(void) dup(0);
(void) dup(0);
+
+ while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
+ ;
+ spin_lock_irq(¤t->sigmask_lock);
+ flush_signals(current);
+ recalc_sigpending(current);
+ spin_unlock_irq(¤t->sigmask_lock);
/*
* We try each of these until one succeeds.
--- 2.4/kernel/context.c Fri Feb 2 15:20:37 2001
+++ build-2.4/kernel/context.c Sat Apr 14 19:09:10 2001
@@ -101,8 +101,10 @@
if (signal_pending(curtask)) {
while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
;
+ spin_lock_irq(&curtask->sigmask_lock);
flush_signals(curtask);
recalc_sigpending(curtask);
+ spin_unlock_irq(&curtask->sigmask_lock);
}
}
}
next prev parent reply other threads:[~2001-04-14 17:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-14 14:00 8139too: defunct threads Manfred Spraul
2001-04-14 16:21 ` Rod Stewart
2001-04-14 17:33 ` Manfred Spraul [this message]
2001-04-14 18:53 ` [PATCH] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AD88A00.DF54EC12@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=stewart@dystopia.lab43.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox