Re: [RFC][PATCH] create workqueue threads only when needed

From: Stefan Richter
Date: Sun Feb 01 2009 - 12:41:13 EST


Arjan van de Ven wrote:
> On Sun, 01 Feb 2009 17:22:47 +0100
> Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx> wrote:
>> I have stuff in drivers/firewire/ done in a private workqueue and some
>> in the shared workqueue which I will eventually move either into
>> short-lived ad hoc created kthreads /or/ preferably into a thread pool
>> implementation --- if such a thing will have found its way into the
>> kernel when I have time for my project.
...
> what are the requirements for you to do this?
>
> right now, the async calls are "fire and forget... but you can wait for
> completion". The "price" is that the code needs to allocate a little
> bit of memory for management overhead. The second price then is that
> if this allocation fails, the code needs to run "in context".
>
> Would this be a problem?
>
> I can add a variant of the API where you pass in some memory of your
> own, which then does not fail. (but also won't get freed automatically
> etc)

I'm not quite sure yet but I believe I can run the work in the current
context if there was an allocation failure, provided those failures are
unlikely.

Hmm. I don't see the "async/mgr" in the process list of that 2.6.29-rc3
box next to me. Under which circumstances is this facility available
(long after boot)? Or am I just barging into a discussion to /make/ it
available after boot?
--
Stefan Richter
-=====-==--= --=- ----=
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/