Messages in this thread | | | From | Lai Jiangshan <> | Date | Tue, 30 Aug 2022 22:16:46 +0800 | Subject | Re: [RFC PATCH v3 1/3] workqueue: Hold wq_pool_mutex while affining tasks to wq_unbound_cpumask |
| |
On Tue, Aug 2, 2022 at 4:42 PM Valentin Schneider <vschneid@redhat.com> wrote: > > When unbind_workers() reads wq_unbound_cpumask to set the affinity of > freshly-unbound kworkers, it only holds wq_pool_attach_mutex. This isn't > sufficient as wq_unbound_cpumask is only protected by wq_pool_mutex. >
Hello Valentin,
Updating wq_unbound_cpumask requires cpus_read_lock() and unbind_workers() is in the CPU hotplug path and so it is sufficient to access to wq_unbound_cpumask in unbind_workers().
The extra protection is only required when the logic is also moved to destroy_worker().
Thanks Lai
| |