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

From: Lai Jiangshan
Date: Tue Jan 13 2015 - 02:07:30 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/