From: Chris Mason <chris.mason@oracle.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: benh@kernel.crashing.org,
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: Mon, 07 Jul 2008 10:09:16 -0400 [thread overview]
Message-ID: <1215439756.24425.21.camel@think.oraclecorp.com> (raw)
In-Reply-To: <1215007896.3330.6.camel@localhost.localdomain>
On Wed, 2008-07-02 at 09:11 -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).
>
workqueues weren't quite right for btrfs either, where I need to be able
to verify checksums after IO completes (among other things). So I also
ended up with a simple thread pool system that can add kthreads on
demand.
So, it sounds like we'd have a number of users for a unified interface.
> 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 have a few different users of the thread pools, and I ended up having
to create a number of pools to avoid deadlocks between different types
of operations on the same work list. Ideas like the next activation
head really sound cool, but the simplicity of just making dedicated
pools to dedicated tasks is much much easier to debug.
If the pools are able to resize themselves sanely, it should perform
about the same as the fancy stuff ;)
-chris
next prev parent reply other threads:[~2008-07-07 14:10 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
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 [this message]
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=1215439756.24425.21.camel@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=benh@kernel.crashing.org \
--cc=jk@ozlabs.org \
--cc=ksummit-2008-discuss@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.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