|
@@ -67,11 +67,10 @@ struct cpu_workqueue_struct {
|
|
* per-CPU workqueues:
|
|
* per-CPU workqueues:
|
|
*/
|
|
*/
|
|
struct workqueue_struct {
|
|
struct workqueue_struct {
|
|
|
|
+ unsigned int flags; /* I: WQ_* flags */
|
|
struct cpu_workqueue_struct *cpu_wq; /* I: cwq's */
|
|
struct cpu_workqueue_struct *cpu_wq; /* I: cwq's */
|
|
struct list_head list; /* W: list of all workqueues */
|
|
struct list_head list; /* W: list of all workqueues */
|
|
const char *name; /* I: workqueue name */
|
|
const char *name; /* I: workqueue name */
|
|
- int singlethread;
|
|
|
|
- int freezeable; /* Freeze threads during suspend */
|
|
|
|
#ifdef CONFIG_LOCKDEP
|
|
#ifdef CONFIG_LOCKDEP
|
|
struct lockdep_map lockdep_map;
|
|
struct lockdep_map lockdep_map;
|
|
#endif
|
|
#endif
|
|
@@ -203,9 +202,9 @@ static const struct cpumask *cpu_singlethread_map __read_mostly;
|
|
static cpumask_var_t cpu_populated_map __read_mostly;
|
|
static cpumask_var_t cpu_populated_map __read_mostly;
|
|
|
|
|
|
/* If it's single threaded, it isn't in the list of workqueues. */
|
|
/* If it's single threaded, it isn't in the list of workqueues. */
|
|
-static inline int is_wq_single_threaded(struct workqueue_struct *wq)
|
|
|
|
|
|
+static inline bool is_wq_single_threaded(struct workqueue_struct *wq)
|
|
{
|
|
{
|
|
- return wq->singlethread;
|
|
|
|
|
|
+ return wq->flags & WQ_SINGLE_THREAD;
|
|
}
|
|
}
|
|
|
|
|
|
static const struct cpumask *wq_cpu_map(struct workqueue_struct *wq)
|
|
static const struct cpumask *wq_cpu_map(struct workqueue_struct *wq)
|
|
@@ -463,7 +462,7 @@ static int worker_thread(void *__cwq)
|
|
struct cpu_workqueue_struct *cwq = __cwq;
|
|
struct cpu_workqueue_struct *cwq = __cwq;
|
|
DEFINE_WAIT(wait);
|
|
DEFINE_WAIT(wait);
|
|
|
|
|
|
- if (cwq->wq->freezeable)
|
|
|
|
|
|
+ if (cwq->wq->flags & WQ_FREEZEABLE)
|
|
set_freezable();
|
|
set_freezable();
|
|
|
|
|
|
for (;;) {
|
|
for (;;) {
|
|
@@ -1013,8 +1012,7 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
|
|
}
|
|
}
|
|
|
|
|
|
struct workqueue_struct *__create_workqueue_key(const char *name,
|
|
struct workqueue_struct *__create_workqueue_key(const char *name,
|
|
- int singlethread,
|
|
|
|
- int freezeable,
|
|
|
|
|
|
+ unsigned int flags,
|
|
struct lock_class_key *key,
|
|
struct lock_class_key *key,
|
|
const char *lock_name)
|
|
const char *lock_name)
|
|
{
|
|
{
|
|
@@ -1030,13 +1028,12 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
|
|
if (!wq->cpu_wq)
|
|
if (!wq->cpu_wq)
|
|
goto err;
|
|
goto err;
|
|
|
|
|
|
|
|
+ wq->flags = flags;
|
|
wq->name = name;
|
|
wq->name = name;
|
|
lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
|
|
lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
|
|
- wq->singlethread = singlethread;
|
|
|
|
- wq->freezeable = freezeable;
|
|
|
|
INIT_LIST_HEAD(&wq->list);
|
|
INIT_LIST_HEAD(&wq->list);
|
|
|
|
|
|
- if (singlethread) {
|
|
|
|
|
|
+ if (flags & WQ_SINGLE_THREAD) {
|
|
cwq = init_cpu_workqueue(wq, singlethread_cpu);
|
|
cwq = init_cpu_workqueue(wq, singlethread_cpu);
|
|
err = create_workqueue_thread(cwq, singlethread_cpu);
|
|
err = create_workqueue_thread(cwq, singlethread_cpu);
|
|
start_workqueue_thread(cwq, -1);
|
|
start_workqueue_thread(cwq, -1);
|