aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-10-12 13:09:27 -0400
committerMark Brown <broonie@kernel.org>2015-10-12 13:09:27 -0400
commit79828b4fa835f73cdaf4bffa48696abdcbea9d02 (patch)
tree5e0fa7156acb75ba603022bc807df8f2fedb97a8 /kernel/workqueue.c
parent721b51fcf91898299d96f4b72cb9434cda29dce6 (diff)
parent8c1a9d6323abf0fb1e5dad96cf3f1c783505ea5a (diff)
Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-fix-rt5645
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c28
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)
2614out_unlock: 2612out_unlock:
2615 mutex_unlock(&wq->mutex); 2613 mutex_unlock(&wq->mutex);
2616} 2614}
2617EXPORT_SYMBOL_GPL(flush_workqueue); 2615EXPORT_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