Skip to content

Commit d8764c1

Browse files
committed
Merge tag 'wq-for-6.11-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue fix from Tejun Heo: "cpus_read_lock() was dropped from workqueue creation path but there were still remaining lockdep_assert_cpus_held() triggering spurious lockdep failures. Remove them" * tag 'wq-for-6.11-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Remove unneeded lockdep_assert_cpus_held()
2 parents c89d780 + aa86847 commit d8764c1

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

kernel/workqueue.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5342,17 +5342,13 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,
53425342
*
53435343
* Performs GFP_KERNEL allocations.
53445344
*
5345-
* Assumes caller has CPU hotplug read exclusion, i.e. cpus_read_lock().
5346-
*
53475345
* Return: 0 on success and -errno on failure.
53485346
*/
53495347
int apply_workqueue_attrs(struct workqueue_struct *wq,
53505348
const struct workqueue_attrs *attrs)
53515349
{
53525350
int ret;
53535351

5354-
lockdep_assert_cpus_held();
5355-
53565352
mutex_lock(&wq_pool_mutex);
53575353
ret = apply_workqueue_attrs_locked(wq, attrs);
53585354
mutex_unlock(&wq_pool_mutex);
@@ -5434,7 +5430,6 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
54345430
bool highpri = wq->flags & WQ_HIGHPRI;
54355431
int cpu, ret;
54365432

5437-
lockdep_assert_cpus_held();
54385433
lockdep_assert_held(&wq_pool_mutex);
54395434

54405435
wq->cpu_pwq = alloc_percpu(struct pool_workqueue *);
@@ -5695,8 +5690,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
56955690

56965691
/*
56975692
* wq_pool_mutex protects the workqueues list, allocations of PWQs,
5698-
* and the global freeze state. alloc_and_link_pwqs() also requires
5699-
* cpus_read_lock() for PWQs' affinities.
5693+
* and the global freeze state.
57005694
*/
57015695
apply_wqattrs_lock();
57025696

@@ -6862,8 +6856,7 @@ static int workqueue_apply_unbound_cpumask(const cpumask_var_t unbound_cpumask)
68626856
* @exclude_cpumask: the cpumask to be excluded from wq_unbound_cpumask
68636857
*
68646858
* This function can be called from cpuset code to provide a set of isolated
6865-
* CPUs that should be excluded from wq_unbound_cpumask. The caller must hold
6866-
* either cpus_read_lock or cpus_write_lock.
6859+
* CPUs that should be excluded from wq_unbound_cpumask.
68676860
*/
68686861
int workqueue_unbound_exclude_cpumask(cpumask_var_t exclude_cpumask)
68696862
{
@@ -6873,7 +6866,6 @@ int workqueue_unbound_exclude_cpumask(cpumask_var_t exclude_cpumask)
68736866
if (!zalloc_cpumask_var(&cpumask, GFP_KERNEL))
68746867
return -ENOMEM;
68756868

6876-
lockdep_assert_cpus_held();
68776869
mutex_lock(&wq_pool_mutex);
68786870

68796871
/*

0 commit comments

Comments
 (0)