Subject: Re: workqueue(9), per-CPU queues [was: Re: soc zfs: taskqueue /
To: None <tech-kern@netbsd.org>
From: Mindaugas R. <rmind@NetBSD.org>
List: tech-kern
Date: 07/11/2007 16:41:03
Andrew Doran <ad@netbsd.org> wrote:
> - I'd prefer the kthreads named ("%s/%d", wq->wq_name, ci->ci_cpuid)
> 
> - If the cpu is not specified, and the workqueue has a thread per-CPU, the
>   item should by default go onto the local CPU's workqueue.
OK.

> - Agreed on all of the above, but I would personally like to see us get this
>   right the first time and that means having the "indexing cpu id". If items
>   are being enqueued thousands of times a second the loop is too expensive.
>   I think the ID could be assigned in mi_cpu_attach().
Good idea. But perhaps we should start thinking about CPU detaching too,
and there should be some table with active/inactive CPUs.
Would we create only a new variable in cpu_info for now?

> If you are to use an index, it probably means dynamically allocating and
> sizing struct workqueue.
Why entire struct workqueue, not only struct workqueue_queue? Such was my
primary intention, but I am not sure how it should behave in CPUs detaching
case?

-- 
Best regards,
Mindaugas
www.NetBSD.org