From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: benh@kernel.crashing.org,
Arjan van de Ven <arjan@linux.intel.com>,
ksummit-2008-discuss@lists.linux-foundation.org,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Jeremy Kerr <jk@ozlabs.org>
Subject: Re: [Ksummit-2008-discuss] Delayed interrupt work, thread pools
Date: Wed, 02 Jul 2008 15:22:00 -0500 [thread overview]
Message-ID: <1215030120.3330.42.camel@localhost.localdomain> (raw)
In-Reply-To: <20080702200047.GA385@goodmis.org>
On Wed, 2008-07-02 at 16:00 -0400, Steven Rostedt wrote:
> On Wed, Jul 02, 2008 at 09:11:36AM -0500, James Bottomley wrote:
> >
> > If you really need the full scheduling capabilities of threads, then it
> > sounds like a threadpool is all you need (and we should just provide a
> > unified interface).
>
> Something like this may also be useful for the RT kernel as well. Being
> able to push off tasks that we could prioritize would be greatly
> beneficial.
>
> Too bad we don't have a lighter task. Looking at the task_struct it
> looks quite heavy, to be storing lots of threads. Perhaps we can clean
> it up some time and remove out anything that would only be useful for
> userspace threads. Not sure how much that would save us.
>
> As for interrupt threads, those would help for some non-RT issues
> (having a better desktop feel) but not for the issue that Ben has been
> stating. I would be interested in knowing exactly what is needing to
> handle a page fault inside the kernel. If we need to do something for a
> user space task, as soon as that task is found the work should be passed
> to that thread.
>
> >
> > Initially you were implying you'd prefer some type of non blockable
> > workqueue (i.e. a workqueue that shifts to the next work item when and
> > earlier item blocks). I can see this construct being useful because it
> > would have easier to use semantics and be more lightweight than a full
> > thread spawn. It strikes me we could use some of the syslets work to do
> > this ... all the queue needs is an "next activation head", which will be
> > the next job in the queue in the absence of blocking. When a job
> > blocks, syslets informs the workqueue and it moves on to the work on the
> > "next activation head". If a prior job unblocks, syslets informs the
> > queue and it moves the "next activation head" to the unblocked job.
> > What this is doing is implementing a really simple scheduler within a
> > single workqueue, which I'm unsure is actually a good idea since
> > schedulers are complex and tricky things, but it is probably worthy of
> > discussion.
>
> I think doing a "mini scheduler" inside a workgroup thread would be a
> major hack. We would have to have hooks into the normal scheduler to
> let the mini-scheduler know something is blocking, and then have that
> scheduler do some work. Not to mention that we need to handle
> preemption.
Not necessarly ... a simplistic round robin is fine.
The work to detect the "am I being blocked" has already been done for
some of the aio patches, so I'm merely suggesting another use for it.
Isn't preemption an orthogonal problem ... it will surely exist even in
the threadpool approach?
> Having a thread pool sounds much more reasonable and easier to
> implement.
Easier to implement, yes. Easier to program, unlikely, and coming with
a large amount of overhead, definitely.
> BTW, if something like this is implemented, I think that it should be a
> replacement for softirqs and tasklets.
James
next prev parent reply other threads:[~2008-07-02 20:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 12:45 Delayed interrupt work, thread pools Benjamin Herrenschmidt
2008-07-01 12:53 ` [Ksummit-2008-discuss] " Matthew Wilcox
2008-07-01 13:38 ` Benjamin Herrenschmidt
2008-07-01 13:02 ` Robin Holt
2008-07-02 1:39 ` Dean Nelson
2008-07-02 2:38 ` Benjamin Herrenschmidt
2008-07-02 2:47 ` Dave Chinner
2008-07-02 14:27 ` [Ksummit-2008-discuss] " Hugh Dickins
2008-07-02 4:22 ` Arjan van de Ven
2008-07-02 5:44 ` Benjamin Herrenschmidt
2008-07-02 11:02 ` Andi Kleen
2008-07-02 11:19 ` Leon Woestenberg
2008-07-02 11:24 ` Andi Kleen
2008-07-02 20:57 ` Benjamin Herrenschmidt
2008-07-02 14:11 ` James Bottomley
2008-07-02 20:00 ` Steven Rostedt
2008-07-02 20:22 ` James Bottomley [this message]
2008-07-02 20:28 ` Arjan van de Ven
2008-07-02 20:40 ` Steven Rostedt
2008-07-02 21:02 ` Benjamin Herrenschmidt
2008-07-02 21:00 ` Benjamin Herrenschmidt
2008-07-03 10:12 ` Eric W. Biederman
2008-07-03 10:31 ` Benjamin Herrenschmidt
2008-07-07 14:09 ` Chris Mason
2008-07-07 23:03 ` Benjamin Herrenschmidt
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=1215030120.3330.42.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=arjan@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=jk@ozlabs.org \
--cc=ksummit-2008-discuss@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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