aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 0c0771f06bfa..f584aba78ca9 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -127,12 +127,20 @@ struct execute_work {
127 .timer = TIMER_INITIALIZER(NULL, 0, 0), \ 127 .timer = TIMER_INITIALIZER(NULL, 0, 0), \
128 } 128 }
129 129
130#define __DEFERRED_WORK_INITIALIZER(n, f) { \
131 .work = __WORK_INITIALIZER((n).work, (f)), \
132 .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \
133 }
134
130#define DECLARE_WORK(n, f) \ 135#define DECLARE_WORK(n, f) \
131 struct work_struct n = __WORK_INITIALIZER(n, f) 136 struct work_struct n = __WORK_INITIALIZER(n, f)
132 137
133#define DECLARE_DELAYED_WORK(n, f) \ 138#define DECLARE_DELAYED_WORK(n, f) \
134 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) 139 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f)
135 140
141#define DECLARE_DEFERRED_WORK(n, f) \
142 struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f)
143
136/* 144/*
137 * initialize a work item's function pointer 145 * initialize a work item's function pointer
138 */ 146 */
@@ -242,7 +250,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
242enum { 250enum {
243 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ 251 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */
244 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 252 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
245 WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ 253 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
246 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 254 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
247 WQ_HIGHPRI = 1 << 4, /* high priority */ 255 WQ_HIGHPRI = 1 << 4, /* high priority */
248 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
@@ -278,11 +286,15 @@ enum {
278 * any specific CPU, not concurrency managed, and all queued works are 286 * any specific CPU, not concurrency managed, and all queued works are
279 * executed immediately as long as max_active limit is not reached and 287 * executed immediately as long as max_active limit is not reached and
280 * resources are available. 288 * resources are available.
289 *
290 * system_freezable_wq is equivalent to system_wq except that it's
291 * freezable.
281 */ 292 */
282extern struct workqueue_struct *system_wq; 293extern struct workqueue_struct *system_wq;
283extern struct workqueue_struct *system_long_wq; 294extern struct workqueue_struct *system_long_wq;
284extern struct workqueue_struct *system_nrt_wq; 295extern struct workqueue_struct *system_nrt_wq;
285extern struct workqueue_struct *system_unbound_wq; 296extern struct workqueue_struct *system_unbound_wq;
297extern struct workqueue_struct *system_freezable_wq;
286 298
287extern struct workqueue_struct * 299extern struct workqueue_struct *
288__alloc_workqueue_key(const char *name, unsigned int flags, int max_active, 300__alloc_workqueue_key(const char *name, unsigned int flags, int max_active,
@@ -310,7 +322,7 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active,
310/** 322/**
311 * alloc_ordered_workqueue - allocate an ordered workqueue 323 * alloc_ordered_workqueue - allocate an ordered workqueue
312 * @name: name of the workqueue 324 * @name: name of the workqueue
313 * @flags: WQ_* flags (only WQ_FREEZEABLE and WQ_MEM_RECLAIM are meaningful) 325 * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful)
314 * 326 *
315 * Allocate an ordered workqueue. An ordered workqueue executes at 327 * Allocate an ordered workqueue. An ordered workqueue executes at
316 * most one work item at any given time in the queued order. They are 328 * most one work item at any given time in the queued order. They are
@@ -327,8 +339,8 @@ alloc_ordered_workqueue(const char *name, unsigned int flags)
327 339
328#define create_workqueue(name) \ 340#define create_workqueue(name) \
329 alloc_workqueue((name), WQ_MEM_RECLAIM, 1) 341 alloc_workqueue((name), WQ_MEM_RECLAIM, 1)
330#define create_freezeable_workqueue(name) \ 342#define create_freezable_workqueue(name) \
331 alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 343 alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
332#define create_singlethread_workqueue(name) \ 344#define create_singlethread_workqueue(name) \
333 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 345 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
334 346
@@ -401,7 +413,7 @@ static inline bool __cancel_delayed_work(struct delayed_work *work)
401} 413}
402 414
403/* Obsolete. use cancel_delayed_work_sync() */ 415/* Obsolete. use cancel_delayed_work_sync() */
404static inline 416static inline __deprecated
405void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, 417void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
406 struct delayed_work *work) 418 struct delayed_work *work)
407{ 419{
@@ -409,7 +421,7 @@ void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
409} 421}
410 422
411/* Obsolete. use cancel_delayed_work_sync() */ 423/* Obsolete. use cancel_delayed_work_sync() */
412static inline 424static inline __deprecated
413void cancel_rearming_delayed_work(struct delayed_work *work) 425void cancel_rearming_delayed_work(struct delayed_work *work)
414{ 426{
415 cancel_delayed_work_sync(work); 427 cancel_delayed_work_sync(work);