Subject: Re: workqueue(9), per-CPU queues [was: Re: soc zfs: taskqueue /
To: None <rmind@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 07/11/2007 14:54:58
> I have modified workqueue(9) interface to have per-CPU queues and threads,
> when a WQ_PERCPU flag is used - as intended by design. Here is a patch:
> http://www.netbsd.org/~rmind/workqueue-2.diff
> Comments?
> 
> -- 
> Best regards,
> Mindaugas
> www.NetBSD.org

- thanks for taking a look at it.

- i'm not happy with iterating a list on each enqueue operations.
  probably it's ok for now, but, at least, please make it a function
  rather than having two copies.

	static struct workqueue_queue *
	workqueue_queue_lookup(struct workqueue *, struct cpu_info *);

  for long term, probably it's useful to have "dense" cpuid which can be
  used as an array index.

- use-after-free in workqueue_finiqueue.

- why s/kmem_alloc/kmem_zalloc/ ?

- why removed the check of kmem_alloc failure?
  iirc, at least currently, it can fail.

- i doubt if it's worth to have a pool for workqueue_queue.

YAMAMOTO Takashi