Re: [PATCH 3/5] workqueue: fixup existing pool->node

Lai Jiangshan
2015-01-13T07:07:23Z

On 12/26/2014 04:14 AM, Tejun Heo wrote:
> On Mon, Dec 15, 2014 at 09:23:49AM +0800, Lai Jiangshan wrote:
>> The pwqs of the old node's cpumask do be discarded. But the pools of the old
>> node's cpumask maybe recycle. For example, a new workqueue's affinity is set to
>> the old node's cpumask before the pool is dead. Any old pool can long live.
>
> Hah? Why can't it just be unhashed so that it can't be looked up for
> new pwqs anymore?
>

unhashing doesn't reduce the complexity in my code.

for_each_pool(pool, pi) {
node = calc_pool_node(pool);
if (pool->node != node)
- pool->node = node;
+ unhash_pool(pool);
}

And any old pool can long live due to:
some works queues themself back and back
the old pool has extremely long pending works

So I prefer to fixup existing pool->node.