Subject: Re: soc zfs: taskqueue / workqueue
To: Brett Lymn <blymn@baesystems.com.au>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 07/10/2007 10:14:50
On Tue, Jul 10, 2007 at 01:57:23PM +1000, Daniel Carosone wrote:

> On Tue, Jul 10, 2007 at 12:08:08PM +1000, Daniel Carosone wrote:
> > I think a small number of general-purpose queues that run [in]
> > particular [..] circumstances would be a great idea
> 
> As well as the instance examples from freebsd, we've talked before
> about per-cpu workqueues each with a cpu-bound lwp processing jobs
> from it, for running things like est frequency changes.

That's now possible with the kthread changes I just committed. If you pass a
non-NULL cpu_info pointer to kthread_create() the thread is created bound to
that CPU. It does not have the ability to automatically create one thread
per-CPU, that must be done manually.

> If you wanted to run something on all cpu's, you could either insert a
> task on all those queues, or arrange for the task to run on the first,
> and add itself to the next cpu's workqueue each time, depending on the
> nature of what you wanted to run.

There are a few classes of problem to be solved, alright.

Andrew