diff options
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4c4f06176f74..ca71582fcfab 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -338,20 +338,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); | |||
338 | #include <trace/events/workqueue.h> | 338 | #include <trace/events/workqueue.h> |
339 | 339 | ||
340 | #define assert_rcu_or_pool_mutex() \ | 340 | #define assert_rcu_or_pool_mutex() \ |
341 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 341 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
342 | lockdep_is_held(&wq_pool_mutex), \ | 342 | !lockdep_is_held(&wq_pool_mutex), \ |
343 | "sched RCU or wq_pool_mutex should be held") | 343 | "sched RCU or wq_pool_mutex should be held") |
344 | 344 | ||
345 | #define assert_rcu_or_wq_mutex(wq) \ | 345 | #define assert_rcu_or_wq_mutex(wq) \ |
346 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 346 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
347 | lockdep_is_held(&wq->mutex), \ | 347 | !lockdep_is_held(&wq->mutex), \ |
348 | "sched RCU or wq->mutex should be held") | 348 | "sched RCU or wq->mutex should be held") |
349 | 349 | ||
350 | #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \ | 350 | #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \ |
351 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 351 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
352 | lockdep_is_held(&wq->mutex) || \ | 352 | !lockdep_is_held(&wq->mutex) && \ |
353 | lockdep_is_held(&wq_pool_mutex), \ | 353 | !lockdep_is_held(&wq_pool_mutex), \ |
354 | "sched RCU, wq->mutex or wq_pool_mutex should be held") | 354 | "sched RCU, wq->mutex or wq_pool_mutex should be held") |
355 | 355 | ||
356 | #define for_each_cpu_worker_pool(pool, cpu) \ | 356 | #define for_each_cpu_worker_pool(pool, cpu) \ |
357 | for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ | 357 | for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ |
@@ -1714,9 +1714,7 @@ static struct worker *create_worker(struct worker_pool *pool) | |||
1714 | goto fail; | 1714 | goto fail; |
1715 | 1715 | ||
1716 | set_user_nice(worker->task, pool->attrs->nice); | 1716 | set_user_nice(worker->task, pool->attrs->nice); |
1717 | 1717 | kthread_bind_mask(worker->task, pool->attrs->cpumask); | |
1718 | /* prevent userland from meddling with cpumask of workqueue workers */ | ||
1719 | worker->task->flags |= PF_NO_SETAFFINITY; | ||
1720 | 1718 | ||
1721 | /* successful, attach the worker to the pool */ | 1719 | /* successful, attach the worker to the pool */ |
1722 | worker_attach_to_pool(worker, pool); | 1720 | worker_attach_to_pool(worker, pool); |
@@ -2614,7 +2612,7 @@ void flush_workqueue(struct workqueue_struct *wq) | |||
2614 | out_unlock: | 2612 | out_unlock: |
2615 | mutex_unlock(&wq->mutex); | 2613 | mutex_unlock(&wq->mutex); |
2616 | } | 2614 | } |
2617 | EXPORT_SYMBOL_GPL(flush_workqueue); | 2615 | EXPORT_SYMBOL(flush_workqueue); |
2618 | 2616 | ||
2619 | /** | 2617 | /** |
2620 | * drain_workqueue - drain a workqueue | 2618 | * drain_workqueue - drain a workqueue |
@@ -3856,7 +3854,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt, | |||
3856 | } | 3854 | } |
3857 | 3855 | ||
3858 | wq->rescuer = rescuer; | 3856 | wq->rescuer = rescuer; |
3859 | rescuer->task->flags |= PF_NO_SETAFFINITY; | 3857 | kthread_bind_mask(rescuer->task, cpu_possible_mask); |
3860 | wake_up_process(rescuer->task); | 3858 | wake_up_process(rescuer->task); |
3861 | } | 3859 | } |
3862 | 3860 | ||