aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6308a4bc6a82..32b1091f21ef 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -58,8 +58,9 @@ struct cpu_workqueue_struct {
58 */ 58 */
59struct workqueue_struct { 59struct workqueue_struct {
60 struct cpu_workqueue_struct *cpu_wq; 60 struct cpu_workqueue_struct *cpu_wq;
61 struct list_head list;
61 const char *name; 62 const char *name;
62 struct list_head list; /* Empty if single thread */ 63 int singlethread;
63 int freezeable; /* Freeze threads during suspend */ 64 int freezeable; /* Freeze threads during suspend */
64}; 65};
65 66
@@ -76,7 +77,7 @@ static cpumask_t cpu_populated_map __read_mostly;
76/* If it's single threaded, it isn't in the list of workqueues. */ 77/* If it's single threaded, it isn't in the list of workqueues. */
77static inline int is_single_threaded(struct workqueue_struct *wq) 78static inline int is_single_threaded(struct workqueue_struct *wq)
78{ 79{
79 return list_empty(&wq->list); 80 return wq->singlethread;
80} 81}
81 82
82static const cpumask_t *wq_cpu_map(struct workqueue_struct *wq) 83static const cpumask_t *wq_cpu_map(struct workqueue_struct *wq)
@@ -401,7 +402,7 @@ static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
401void fastcall flush_workqueue(struct workqueue_struct *wq) 402void fastcall flush_workqueue(struct workqueue_struct *wq)
402{ 403{
403 const cpumask_t *cpu_map = wq_cpu_map(wq); 404 const cpumask_t *cpu_map = wq_cpu_map(wq);
404 int cpu 405 int cpu;
405 406
406 might_sleep(); 407 might_sleep();
407 for_each_cpu_mask(cpu, *cpu_map) 408 for_each_cpu_mask(cpu, *cpu_map)
@@ -694,10 +695,11 @@ struct workqueue_struct *__create_workqueue(const char *name,
694 } 695 }
695 696
696 wq->name = name; 697 wq->name = name;
698 wq->singlethread = singlethread;
697 wq->freezeable = freezeable; 699 wq->freezeable = freezeable;
700 INIT_LIST_HEAD(&wq->list);
698 701
699 if (singlethread) { 702 if (singlethread) {
700 INIT_LIST_HEAD(&wq->list);
701 cwq = init_cpu_workqueue(wq, singlethread_cpu); 703 cwq = init_cpu_workqueue(wq, singlethread_cpu);
702 err = create_workqueue_thread(cwq, singlethread_cpu); 704 err = create_workqueue_thread(cwq, singlethread_cpu);
703 } else { 705 } else {