Subject: Re: soc zfs: taskqueue / workqueue
To: Daniel Carosone <dan@geek.com.au>
From: Oliver Gould <ogould@olix0r.net>
List: tech-kern
Date: 07/10/2007 12:01:56
Don't worry- I'm not getting too off-task wrt SoC.  I am curious about
this issue, though, and I'd like to understand it a bit better.

On 2007-07-10 12:08 -0500, Daniel Carosone wrote:
> On Tue, Jul 10, 2007 at 09:56:47AM +0930, Brett Lymn wrote:

> > I think we may be getting taskqueue in the future, so for the sake of
> > expediency you could just use a kthread and comment it to be converted
> > to a taskqueue later.
> 
> Forgive me if I've misunderstood, but the way I see it, workqueue(9)
> lets us set up queues for things to schedule jobs on, without really
> being proscriptive about what those things should be or how they
> should correspond to threads and queues.

Workqueue and taskqueue operate, conceptually, differently.  Workqueue
queues data objects (work) to pass to a handler function specified at
creation-time.  Taskqueue queues up function calls to invoke.
(right?)

It guess it's somewhat straightforward to consider taskqueue as a
special-case of workqueue where the work is a function pointer and the
handler simply invokes the passed function-- especially if the queue of
work is made to be a priority queue.

Is this what you're talking about as far as workqueue being more
generic?

WRT having a dedicated worker thread for either, I agree, and it is
orthogonal to implementing taskqueue in NetBSD.  Either way, having
*some* implementation of taskqueue at least /seems/ useful (esp. for
porting code from FreeBSD).

  - Oliver