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

From: Arjan van de Ven
Date: Sun Feb 01 2009 - 12:04:40 EST


On Sun, 01 Feb 2009 17:22:47 +0100
Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx> wrote:

> > I don't know, most of those I've looked on are not documented about
> > the reason for a private workqueue. I guess most of them can use
> > the usual kevent.
>
> 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.
>
> I need to get callers of scsi_add_device and scsi_remove_device out of
> the picture.

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)



--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
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/