From: Andrew Morton <akpm@zip.com.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch] kwaitd, 2.5.31-A1
Date: Tue, 13 Aug 2002 11:05:28 -0700 [thread overview]
Message-ID: <3D594A68.88807CEE@zip.com.au> (raw)
In-Reply-To: Pine.LNX.4.44.0208131928320.4369-100000@localhost.localdomain
Ingo Molnar wrote:
>
> On Tue, 13 Aug 2002, Andrew Morton wrote:
>
> > > the reaping of the thread is thus not done by the parent (or init), but by
> > > per-CPU [kwaitd] kernel threads. The exiting thread queues itself always
> > > to the CPU-local kwaitd queue, to maintain locality of reference and cheap
> > > switching to kwaitd.
> >
> > I'd be inclined to agree with hch on that. We have an awful lot of
> > kernel threads nowadays, and keventd would fill the bill.
>
> i agree. What i did was i looked at the kernel-source as-is, and there was
> no mechanism to do this properly so i took a different approach. Could
> anyone send me per-CPU keventd patches? The thread-exit path is pretty
> timing-critical, the current global keventd spinlock does not work.
I think Arjan has them, or the AIO patch.
> ...
> > And a question: is it not possible to make the exitting task just go and
> > reap itself? If it's a matter of freeing the stack pages we could just
> > add the page to a per-cpu deferred freeing list and reap it in page
> > reclaim.
>
> well, yes - but i dislike deferred freeing lists, it's always a problem
> where to free the RAM for real. It didnt really work for bhs, it didnt
> really work for other items either. And we have this nice lazy-TLB
> mechanism for kernel threads so it's really a non-issue to use them.
Well what we can do in there is to just have a one-deep percpu list.
So the exitting task frees the previous thread's stack (if any)
and inserts its own stack. And that stack can be used in fork, of
course. Which gives some per-cpu LIFO stack allocation.
It would mean that the thread would have to exit with preempt disabled,
but AFAIK that's just a matter of fixing or deleting that debug warning.
next prev parent reply other threads:[~2002-08-13 17:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-13 16:01 [patch] kwaitd, 2.5.31-A1 Ingo Molnar
2002-08-13 16:16 ` Christoph Hellwig
2002-08-13 17:35 ` Andrew Morton
2002-08-13 17:37 ` Ingo Molnar
2002-08-13 18:05 ` Andrew Morton [this message]
2002-08-13 17:59 ` Ingo Molnar
2002-08-13 18:58 ` [patch] clone-detached-2.5.31-A1 Ingo Molnar
2002-08-13 19:44 ` Ingo Molnar
2002-08-13 17:42 ` [patch] kwaitd, 2.5.31-A1 Ingo Molnar
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=3D594A68.88807CEE@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@transmeta.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.