diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 13:04:44 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 13:04:44 -0400 |
| commit | c4c3f5fba01e189fb3618f09545abdb4cf8ec8ee (patch) | |
| tree | 2939a5d998104ddd5d68b44337956f668f2d701a /include | |
| parent | 1bff598860f535e525c2a549f7f584ae7cc3fc1c (diff) | |
| parent | 95847e1bd34c0de86039408b24a05f07e788061d (diff) | |
Merge branch 'for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue updates from Tejun Heo:
"Lai has been doing a lot of cleanups of workqueue and kthread_work.
No significant behavior change. Just a lot of cleanups all over the
place. Some are a bit invasive but overall nothing too dangerous"
* 'for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
kthread_work: remove the unused wait_queue_head
kthread_work: wake up worker only when the worker is idle
workqueue: use nr_node_ids instead of wq_numa_tbl_len
workqueue: remove the misnamed out_unlock label in get_unbound_pool()
workqueue: remove the stale comment in pwq_unbound_release_workfn()
workqueue: move rescuer pool detachment to the end
workqueue: unfold start_worker() into create_worker()
workqueue: remove @wakeup from worker_set_flags()
workqueue: remove an unneeded UNBOUND test before waking up the next worker
workqueue: wake regular worker if need_more_worker() when rescuer leave the pool
workqueue: alloc struct worker on its local node
workqueue: reuse the already calculated pwq in try_to_grab_pending()
workqueue: stronger test in process_one_work()
workqueue: clear POOL_DISASSOCIATED in rebind_workers()
workqueue: sanity check pool->cpu in wq_worker_sleeping()
workqueue: clear leftover flags when detached
workqueue: remove useless WARN_ON_ONCE()
workqueue: use schedule_timeout_interruptible() instead of open code
workqueue: remove the empty check in too_many_workers()
workqueue: use "pool->cpu < 0" to stand for an unbound pool
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/kthread.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 7dcef3317689..13d55206ccf6 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -73,7 +73,6 @@ struct kthread_worker { | |||
| 73 | struct kthread_work { | 73 | struct kthread_work { |
| 74 | struct list_head node; | 74 | struct list_head node; |
| 75 | kthread_work_func_t func; | 75 | kthread_work_func_t func; |
| 76 | wait_queue_head_t done; | ||
| 77 | struct kthread_worker *worker; | 76 | struct kthread_worker *worker; |
| 78 | }; | 77 | }; |
| 79 | 78 | ||
| @@ -85,7 +84,6 @@ struct kthread_work { | |||
| 85 | #define KTHREAD_WORK_INIT(work, fn) { \ | 84 | #define KTHREAD_WORK_INIT(work, fn) { \ |
| 86 | .node = LIST_HEAD_INIT((work).node), \ | 85 | .node = LIST_HEAD_INIT((work).node), \ |
| 87 | .func = (fn), \ | 86 | .func = (fn), \ |
| 88 | .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \ | ||
| 89 | } | 87 | } |
| 90 | 88 | ||
| 91 | #define DEFINE_KTHREAD_WORKER(worker) \ | 89 | #define DEFINE_KTHREAD_WORKER(worker) \ |
| @@ -95,22 +93,16 @@ struct kthread_work { | |||
| 95 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) | 93 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) |
| 96 | 94 | ||
| 97 | /* | 95 | /* |
| 98 | * kthread_worker.lock and kthread_work.done need their own lockdep class | 96 | * kthread_worker.lock needs its own lockdep class key when defined on |
| 99 | * keys if they are defined on stack with lockdep enabled. Use the | 97 | * stack with lockdep enabled. Use the following macros in such cases. |
| 100 | * following macros when defining them on stack. | ||
| 101 | */ | 98 | */ |
| 102 | #ifdef CONFIG_LOCKDEP | 99 | #ifdef CONFIG_LOCKDEP |
| 103 | # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ | 100 | # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ |
| 104 | ({ init_kthread_worker(&worker); worker; }) | 101 | ({ init_kthread_worker(&worker); worker; }) |
| 105 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ | 102 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ |
| 106 | struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) | 103 | struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) |
| 107 | # define KTHREAD_WORK_INIT_ONSTACK(work, fn) \ | ||
| 108 | ({ init_kthread_work((&work), fn); work; }) | ||
| 109 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) \ | ||
| 110 | struct kthread_work work = KTHREAD_WORK_INIT_ONSTACK(work, fn) | ||
| 111 | #else | 104 | #else |
| 112 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) | 105 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) |
| 113 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) DEFINE_KTHREAD_WORK(work, fn) | ||
| 114 | #endif | 106 | #endif |
| 115 | 107 | ||
| 116 | extern void __init_kthread_worker(struct kthread_worker *worker, | 108 | extern void __init_kthread_worker(struct kthread_worker *worker, |
| @@ -127,7 +119,6 @@ extern void __init_kthread_worker(struct kthread_worker *worker, | |||
| 127 | memset((work), 0, sizeof(struct kthread_work)); \ | 119 | memset((work), 0, sizeof(struct kthread_work)); \ |
| 128 | INIT_LIST_HEAD(&(work)->node); \ | 120 | INIT_LIST_HEAD(&(work)->node); \ |
| 129 | (work)->func = (fn); \ | 121 | (work)->func = (fn); \ |
| 130 | init_waitqueue_head(&(work)->done); \ | ||
| 131 | } while (0) | 122 | } while (0) |
| 132 | 123 | ||
| 133 | int kthread_worker_fn(void *worker_ptr); | 124 | int kthread_worker_fn(void *worker_ptr); |
