diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-07 00:59:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-07 00:59:31 -0400 |
commit | 9954d4892a813155cf808b1c29df50886b5672cf (patch) | |
tree | 7988449c499804aab0550a4e7381b417dbc6980e | |
parent | a7cbfd05f427f8f1164bc53866971e89a0cbe103 (diff) | |
parent | fbf1c41fc0f4d3574ac2377245efd666c1fa3075 (diff) |
Merge branch 'for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue updates from Tejun Heo:
"Nothing major. I introduced a flag collsion bug during v4.13 cycle
which is fixed in this pull request. Fortunately, the flag is for
debugging / verification and the bug isn't critical"
* 'for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
workqueue: Fix flag collision
workqueue: Use TASK_IDLE
workqueue: fix path to documentation
workqueue: doc change for ST behavior on NUMA systems
-rw-r--r-- | Documentation/core-api/workqueue.rst | 10 | ||||
-rw-r--r-- | include/linux/workqueue.h | 2 | ||||
-rw-r--r-- | kernel/workqueue.c | 6 |
3 files changed, 11 insertions, 7 deletions
diff --git a/Documentation/core-api/workqueue.rst b/Documentation/core-api/workqueue.rst index ffdec94fbca1..3943b5bfa8cf 100644 --- a/Documentation/core-api/workqueue.rst +++ b/Documentation/core-api/workqueue.rst | |||
@@ -243,11 +243,15 @@ throttling the number of active work items, specifying '0' is | |||
243 | recommended. | 243 | recommended. |
244 | 244 | ||
245 | Some users depend on the strict execution ordering of ST wq. The | 245 | Some users depend on the strict execution ordering of ST wq. The |
246 | combination of ``@max_active`` of 1 and ``WQ_UNBOUND`` is used to | 246 | combination of ``@max_active`` of 1 and ``WQ_UNBOUND`` used to |
247 | achieve this behavior. Work items on such wq are always queued to the | 247 | achieve this behavior. Work items on such wq were always queued to the |
248 | unbound worker-pools and only one work item can be active at any given | 248 | unbound worker-pools and only one work item could be active at any given |
249 | time thus achieving the same ordering property as ST wq. | 249 | time thus achieving the same ordering property as ST wq. |
250 | 250 | ||
251 | In the current implementation the above configuration only guarantees | ||
252 | ST behavior within a given NUMA node. Instead alloc_ordered_queue should | ||
253 | be used to achieve system wide ST behavior. | ||
254 | |||
251 | 255 | ||
252 | Example Execution Scenarios | 256 | Example Execution Scenarios |
253 | =========================== | 257 | =========================== |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index db6dc9dc0482..1c49431f3121 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -323,8 +323,8 @@ enum { | |||
323 | 323 | ||
324 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ | 324 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
325 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ | 325 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
326 | __WQ_ORDERED_EXPLICIT = 1 << 18, /* internal: alloc_ordered_workqueue() */ | ||
327 | __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */ | 326 | __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */ |
327 | __WQ_ORDERED_EXPLICIT = 1 << 19, /* internal: alloc_ordered_workqueue() */ | ||
328 | 328 | ||
329 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ | 329 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
330 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ | 330 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ab3c0dc8c7ed..64d0edf428f8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * pools for workqueues which are not bound to any specific CPU - the | 21 | * pools for workqueues which are not bound to any specific CPU - the |
22 | * number of these backing pools is dynamic. | 22 | * number of these backing pools is dynamic. |
23 | * | 23 | * |
24 | * Please read Documentation/workqueue.txt for details. | 24 | * Please read Documentation/core-api/workqueue.rst for details. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <linux/export.h> | 27 | #include <linux/export.h> |
@@ -2269,7 +2269,7 @@ sleep: | |||
2269 | * event. | 2269 | * event. |
2270 | */ | 2270 | */ |
2271 | worker_enter_idle(worker); | 2271 | worker_enter_idle(worker); |
2272 | __set_current_state(TASK_INTERRUPTIBLE); | 2272 | __set_current_state(TASK_IDLE); |
2273 | spin_unlock_irq(&pool->lock); | 2273 | spin_unlock_irq(&pool->lock); |
2274 | schedule(); | 2274 | schedule(); |
2275 | goto woke_up; | 2275 | goto woke_up; |
@@ -2311,7 +2311,7 @@ static int rescuer_thread(void *__rescuer) | |||
2311 | */ | 2311 | */ |
2312 | rescuer->task->flags |= PF_WQ_WORKER; | 2312 | rescuer->task->flags |= PF_WQ_WORKER; |
2313 | repeat: | 2313 | repeat: |
2314 | set_current_state(TASK_INTERRUPTIBLE); | 2314 | set_current_state(TASK_IDLE); |
2315 | 2315 | ||
2316 | /* | 2316 | /* |
2317 | * By the time the rescuer is requested to stop, the workqueue | 2317 | * By the time the rescuer is requested to stop, the workqueue |