From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>,
Anton Blanchard <anton@samba.org>, Andrew Morton <akpm@osdl.org>,
linuxppc64-dev <linuxppc64-dev@ozlabs.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: PATCH [PPC64]: dead processes never reaped
Date: Wed, 20 Apr 2005 15:44:10 +1000 [thread overview]
Message-ID: <1113975850.5515.377.camel@gaston> (raw)
In-Reply-To: <20050418193833.GW15596@austin.ibm.com>
On Mon, 2005-04-18 at 14:38 -0500, Linas Vepstas wrote:
>
> Hi,
>
> The patch below appears to fix a problem where a number of dead processes
> linger on the system. On a highly loaded system, dozens of processes
> were found stuck in do_exit(), calling thier very last schedule(), and
> then being lost forever.
Ok, we spent some time with Paul decrypting what _switch_to is supposed
to do. Our understanding at this point is that the current code is
correct on both ppc32 and ppc64, that is:
The "prev" passed in is always "current" and we don't see how it can be
anything else. We use a local variable instead of current in the common
code because accessing current can be slow on some architectures. I
don't see any codepath where prev != current before switch_to.
If we didn't do some black magic that I explain below, _switch_to would
switch the entire context, including stack, and thus including the value
of "prev". Which means that we would always come back with prev beeing
current, which is useless for reaping the old task. What we want is that
this "prev" that was passed to _switch_to() is returned so that we can
rip that previous task despite the change of context, that is basically
prev has to be an invariant vs. the change of context in switch_to.
On ppc & ppc64, we implement that by passing that prev (or it's thread
counterpart) to the assembly context switch code in r3. This code will
preserve it and return it as-is (or re-transformed from thread to task).
So your problem must be somewhere else. I've looked at the need_resched
code path and we always reload prev = current from a non-preemptible
region, so it can't be wrong.
This was verified on 2.6.12-rc2, there might be something else wrong in
an older kernel.
Ben.
next prev parent reply other threads:[~2005-04-20 5:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-18 19:38 PATCH [PPC64]: dead processes never reaped Linas Vepstas
2005-04-19 1:01 ` Benjamin Herrenschmidt
2005-04-19 17:39 ` Linas Vepstas
2005-04-19 1:07 ` Benjamin Herrenschmidt
2005-04-19 1:25 ` Nick Piggin
2005-04-19 17:22 ` Linas Vepstas
2005-04-20 5:44 ` Benjamin Herrenschmidt [this message]
2005-05-05 21:57 ` Linas Vepstas
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=1113975850.5515.377.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=linas@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=paulus@samba.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