Re: [PATCHSET] workqueue: remove gcwq and make worker_pool the only backend abstraction

Tejun Heo
2013-01-24T18:51:11Z

Hey, Lai.

On Thu, Jan 24, 2013 at 09:36:39PM +0800, Lai Jiangshan wrote:
> For the whole patchset
> Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>

Thanks for reviewing it.

> The only concern: get_work_pool() may slow down __queue_work().

Yeap, I'm currently working on to optimize idr so that the fast path
basically comes down to

if (id < FIRST_LAYER_LIMIT)
return idr->first_layer[id];

> I think we can save the pool->id at work_struct->entry.next, It will
> simply the code a little.

Hmm... I'm not sure whether saving id somewhere else would make any
noticeable difference. Decoding ->id probalby comes down to a couple
bit shuffling instructions.

> More aggressive, we can save the work_pool
> pointer at work_struct->entry.next, it will simply more code and
> __queue_work() will not be slowed down. (It is the user's
> responsibility not to modify work_struct if the user want to pass it
> to workqueue API later)

We probably can't store pointers to pools directly because custom
pools will need to be dynamically created and destroyed.

Thanks.

--
tejun