aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/workqueue.h23
-rw-r--r--kernel/workqueue.c10
2 files changed, 15 insertions, 18 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 4f9d3bc161a2..855fcdaa2d72 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -297,10 +297,6 @@ enum {
297 * system_long_wq is similar to system_wq but may host long running 297 * system_long_wq is similar to system_wq but may host long running
298 * works. Queue flushing might take relatively long. 298 * works. Queue flushing might take relatively long.
299 * 299 *
300 * system_nrt_wq is non-reentrant and guarantees that any given work
301 * item is never executed in parallel by multiple CPUs. Queue
302 * flushing might take relatively long.
303 *
304 * system_unbound_wq is unbound workqueue. Workers are not bound to 300 * system_unbound_wq is unbound workqueue. Workers are not bound to
305 * any specific CPU, not concurrency managed, and all queued works are 301 * any specific CPU, not concurrency managed, and all queued works are
306 * executed immediately as long as max_active limit is not reached and 302 * executed immediately as long as max_active limit is not reached and
@@ -308,16 +304,25 @@ enum {
308 * 304 *
309 * system_freezable_wq is equivalent to system_wq except that it's 305 * system_freezable_wq is equivalent to system_wq except that it's
310 * freezable. 306 * freezable.
311 *
312 * system_nrt_freezable_wq is equivalent to system_nrt_wq except that
313 * it's freezable.
314 */ 307 */
315extern struct workqueue_struct *system_wq; 308extern struct workqueue_struct *system_wq;
316extern struct workqueue_struct *system_long_wq; 309extern struct workqueue_struct *system_long_wq;
317extern struct workqueue_struct *system_nrt_wq;
318extern struct workqueue_struct *system_unbound_wq; 310extern struct workqueue_struct *system_unbound_wq;
319extern struct workqueue_struct *system_freezable_wq; 311extern struct workqueue_struct *system_freezable_wq;
320extern struct workqueue_struct *system_nrt_freezable_wq; 312
313static inline struct workqueue_struct *__system_nrt_wq(void)
314{
315 return system_wq;
316}
317
318static inline struct workqueue_struct *__system_nrt_freezable_wq(void)
319{
320 return system_freezable_wq;
321}
322
323/* equivlalent to system_wq and system_freezable_wq, deprecated */
324#define system_nrt_wq __system_nrt_wq()
325#define system_nrt_freezable_wq __system_nrt_freezable_wq()
321 326
322extern struct workqueue_struct * 327extern struct workqueue_struct *
323__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, 328__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 5f13a9a2c792..85bd3409b9f5 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -274,14 +274,10 @@ struct workqueue_struct *system_highpri_wq __read_mostly;
274EXPORT_SYMBOL_GPL(system_highpri_wq); 274EXPORT_SYMBOL_GPL(system_highpri_wq);
275struct workqueue_struct *system_long_wq __read_mostly; 275struct workqueue_struct *system_long_wq __read_mostly;
276EXPORT_SYMBOL_GPL(system_long_wq); 276EXPORT_SYMBOL_GPL(system_long_wq);
277struct workqueue_struct *system_nrt_wq __read_mostly;
278EXPORT_SYMBOL_GPL(system_nrt_wq);
279struct workqueue_struct *system_unbound_wq __read_mostly; 277struct workqueue_struct *system_unbound_wq __read_mostly;
280EXPORT_SYMBOL_GPL(system_unbound_wq); 278EXPORT_SYMBOL_GPL(system_unbound_wq);
281struct workqueue_struct *system_freezable_wq __read_mostly; 279struct workqueue_struct *system_freezable_wq __read_mostly;
282EXPORT_SYMBOL_GPL(system_freezable_wq); 280EXPORT_SYMBOL_GPL(system_freezable_wq);
283struct workqueue_struct *system_nrt_freezable_wq __read_mostly;
284EXPORT_SYMBOL_GPL(system_nrt_freezable_wq);
285 281
286#define CREATE_TRACE_POINTS 282#define CREATE_TRACE_POINTS
287#include <trace/events/workqueue.h> 283#include <trace/events/workqueue.h>
@@ -3838,16 +3834,12 @@ static int __init init_workqueues(void)
3838 system_wq = alloc_workqueue("events", 0, 0); 3834 system_wq = alloc_workqueue("events", 0, 0);
3839 system_highpri_wq = alloc_workqueue("events_highpri", WQ_HIGHPRI, 0); 3835 system_highpri_wq = alloc_workqueue("events_highpri", WQ_HIGHPRI, 0);
3840 system_long_wq = alloc_workqueue("events_long", 0, 0); 3836 system_long_wq = alloc_workqueue("events_long", 0, 0);
3841 system_nrt_wq = alloc_workqueue("events_nrt", WQ_NON_REENTRANT, 0);
3842 system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND, 3837 system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND,
3843 WQ_UNBOUND_MAX_ACTIVE); 3838 WQ_UNBOUND_MAX_ACTIVE);
3844 system_freezable_wq = alloc_workqueue("events_freezable", 3839 system_freezable_wq = alloc_workqueue("events_freezable",
3845 WQ_FREEZABLE, 0); 3840 WQ_FREEZABLE, 0);
3846 system_nrt_freezable_wq = alloc_workqueue("events_nrt_freezable",
3847 WQ_NON_REENTRANT | WQ_FREEZABLE, 0);
3848 BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq || 3841 BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq ||
3849 !system_nrt_wq || !system_unbound_wq || !system_freezable_wq || 3842 !system_unbound_wq || !system_freezable_wq);
3850 !system_nrt_freezable_wq);
3851 return 0; 3843 return 0;
3852} 3844}
3853early_initcall(init_workqueues); 3845early_initcall(init_workqueues);