diff options
Diffstat (limited to 'include/linux/workqueue.h')
| -rw-r--r-- | include/linux/workqueue.h | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index fc6e22186405..a26cc437293c 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -119,18 +119,30 @@ struct delayed_work { | |||
| 119 | int cpu; | 119 | int cpu; |
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | /* | 122 | /** |
| 123 | * A struct for workqueue attributes. This can be used to change | 123 | * struct workqueue_attrs - A struct for workqueue attributes. |
| 124 | * attributes of an unbound workqueue. | ||
| 125 | * | 124 | * |
| 126 | * Unlike other fields, ->no_numa isn't a property of a worker_pool. It | 125 | * This can be used to change attributes of an unbound workqueue. |
| 127 | * only modifies how apply_workqueue_attrs() select pools and thus doesn't | ||
| 128 | * participate in pool hash calculations or equality comparisons. | ||
| 129 | */ | 126 | */ |
| 130 | struct workqueue_attrs { | 127 | struct workqueue_attrs { |
| 131 | int nice; /* nice level */ | 128 | /** |
| 132 | cpumask_var_t cpumask; /* allowed CPUs */ | 129 | * @nice: nice level |
| 133 | bool no_numa; /* disable NUMA affinity */ | 130 | */ |
| 131 | int nice; | ||
| 132 | |||
| 133 | /** | ||
| 134 | * @cpumask: allowed CPUs | ||
| 135 | */ | ||
| 136 | cpumask_var_t cpumask; | ||
| 137 | |||
| 138 | /** | ||
| 139 | * @no_numa: disable NUMA affinity | ||
| 140 | * | ||
| 141 | * Unlike other fields, ``no_numa`` isn't a property of a worker_pool. It | ||
| 142 | * only modifies how :c:func:`apply_workqueue_attrs` select pools and thus | ||
| 143 | * doesn't participate in pool hash calculations or equality comparisons. | ||
| 144 | */ | ||
| 145 | bool no_numa; | ||
| 134 | }; | 146 | }; |
| 135 | 147 | ||
| 136 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) | 148 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) |
| @@ -272,7 +284,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 272 | 284 | ||
| 273 | /* | 285 | /* |
| 274 | * Workqueue flags and constants. For details, please refer to | 286 | * Workqueue flags and constants. For details, please refer to |
| 275 | * Documentation/workqueue.txt. | 287 | * Documentation/core-api/workqueue.rst. |
| 276 | */ | 288 | */ |
| 277 | enum { | 289 | enum { |
| 278 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 290 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
| @@ -370,7 +382,8 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
| 370 | * @args...: args for @fmt | 382 | * @args...: args for @fmt |
| 371 | * | 383 | * |
| 372 | * Allocate a workqueue with the specified parameters. For detailed | 384 | * Allocate a workqueue with the specified parameters. For detailed |
| 373 | * information on WQ_* flags, please refer to Documentation/workqueue.txt. | 385 | * information on WQ_* flags, please refer to |
| 386 | * Documentation/core-api/workqueue.rst. | ||
| 374 | * | 387 | * |
| 375 | * The __lock_name macro dance is to guarantee that single lock_class_key | 388 | * The __lock_name macro dance is to guarantee that single lock_class_key |
| 376 | * doesn't end up with different namesm, which isn't allowed by lockdep. | 389 | * doesn't end up with different namesm, which isn't allowed by lockdep. |
| @@ -590,14 +603,6 @@ static inline bool schedule_delayed_work(struct delayed_work *dwork, | |||
| 590 | return queue_delayed_work(system_wq, dwork, delay); | 603 | return queue_delayed_work(system_wq, dwork, delay); |
| 591 | } | 604 | } |
| 592 | 605 | ||
| 593 | /** | ||
| 594 | * keventd_up - is workqueue initialized yet? | ||
| 595 | */ | ||
| 596 | static inline bool keventd_up(void) | ||
| 597 | { | ||
| 598 | return system_wq != NULL; | ||
| 599 | } | ||
| 600 | |||
| 601 | #ifndef CONFIG_SMP | 606 | #ifndef CONFIG_SMP |
| 602 | static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg) | 607 | static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg) |
| 603 | { | 608 | { |
| @@ -632,4 +637,7 @@ int workqueue_online_cpu(unsigned int cpu); | |||
| 632 | int workqueue_offline_cpu(unsigned int cpu); | 637 | int workqueue_offline_cpu(unsigned int cpu); |
| 633 | #endif | 638 | #endif |
| 634 | 639 | ||
| 640 | int __init workqueue_init_early(void); | ||
| 641 | int __init workqueue_init(void); | ||
| 642 | |||
| 635 | #endif | 643 | #endif |
