Re: contention on pwq->pool->lock under heavy NFS workload

From: Tejun Heo
Date: Mon Jun 26 2023 - 16:21:35 EST


On Sun, Jun 25, 2023 at 04:01:38PM +0000, Chuck Lever III wrote:
> Both wq_pool_mutex and copy_workqueue_attrs() are static, so having
> only apply_workqueue_attrs() is not yet enough to carry this off
> in workqueue consumers such as sunrpc.ko.
>
> It looks like padata_setup_cpumasks() for example is holding the
> CPU read lock, but it doesn't take the wq_pool_mutex.
> apply_wqattrs_prepare() has a "lockdep_assert_held(&wq_pool_mutex);" .
>
> I can wait for a v3 of this series so you can construct the public
> API the way you prefer.

Ah, indeed. That API isn't really useable right now. It's gonna be a while
before the affinity scope patches are applied. I'll fix up the apply
interface afterwards.

Thanks.

--
tejun