aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-06-29 04:07:14 -0400
committerTejun Heo <tj@kernel.org>2010-06-29 04:07:14 -0400
commitb71ab8c2025caef8db719aa41af0ed735dc543cd (patch)
tree8cc2c6164acf5fe82e8d8d05924590cb80fe088d /include/linux/workqueue.h
parente22bee782b3b00bd4534ae9b1c5fb2e8e6573c5c (diff)
workqueue: increase max_active of keventd and kill current_is_keventd()
Define WQ_MAX_ACTIVE and create keventd with max_active set to half of it which means that keventd now can process upto WQ_MAX_ACTIVE / 2 - 1 works concurrently. Unless some combination can result in dependency loop longer than max_active, deadlock won't happen and thus it's unnecessary to check whether current_is_keventd() before trying to schedule a work. Kill current_is_keventd(). (Lockdep annotations are broken. We need lock_map_acquire_read_norecurse()) Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index b8f4ec45c40a..33e24e734d50 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -227,6 +227,9 @@ enum {
227 WQ_SINGLE_CPU = 1 << 1, /* only single cpu at a time */ 227 WQ_SINGLE_CPU = 1 << 1, /* only single cpu at a time */
228 WQ_NON_REENTRANT = 1 << 2, /* guarantee non-reentrance */ 228 WQ_NON_REENTRANT = 1 << 2, /* guarantee non-reentrance */
229 WQ_RESCUER = 1 << 3, /* has an rescue worker */ 229 WQ_RESCUER = 1 << 3, /* has an rescue worker */
230
231 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
232 WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2,
230}; 233};
231 234
232extern struct workqueue_struct * 235extern struct workqueue_struct *
@@ -280,7 +283,6 @@ extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay)
280extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, 283extern int schedule_delayed_work_on(int cpu, struct delayed_work *work,
281 unsigned long delay); 284 unsigned long delay);
282extern int schedule_on_each_cpu(work_func_t func); 285extern int schedule_on_each_cpu(work_func_t func);
283extern int current_is_keventd(void);
284extern int keventd_up(void); 286extern int keventd_up(void);
285 287
286extern void init_workqueues(void); 288extern void init_workqueues(void);