aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-04-24 07:42:54 -0400
committerTejun Heo <tj@kernel.org>2013-05-14 13:50:06 -0400
commit0668106ca3865ba945e155097fb042bf66d364d3 (patch)
treefbd6adfc2ae2f3c2b7fe7ad66d82cd7c64a001fb /kernel/workqueue.c
parentcee22a15052faa817e3ec8985a28154d3fabc7aa (diff)
workqueue: Add system wide power_efficient workqueues
This patch adds system wide workqueues aligned towards power saving. This is done by allocating them with WQ_UNBOUND flag if 'wq_power_efficient' is set to 'true'. tj: updated comments a bit. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 8068d97ce141..16ca2d3dd29f 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -314,6 +314,10 @@ struct workqueue_struct *system_unbound_wq __read_mostly;
314EXPORT_SYMBOL_GPL(system_unbound_wq); 314EXPORT_SYMBOL_GPL(system_unbound_wq);
315struct workqueue_struct *system_freezable_wq __read_mostly; 315struct workqueue_struct *system_freezable_wq __read_mostly;
316EXPORT_SYMBOL_GPL(system_freezable_wq); 316EXPORT_SYMBOL_GPL(system_freezable_wq);
317struct workqueue_struct *system_power_efficient_wq __read_mostly;
318EXPORT_SYMBOL_GPL(system_power_efficient_wq);
319struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly;
320EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq);
317 321
318static int worker_thread(void *__worker); 322static int worker_thread(void *__worker);
319static void copy_workqueue_attrs(struct workqueue_attrs *to, 323static void copy_workqueue_attrs(struct workqueue_attrs *to,
@@ -4987,8 +4991,15 @@ static int __init init_workqueues(void)
4987 WQ_UNBOUND_MAX_ACTIVE); 4991 WQ_UNBOUND_MAX_ACTIVE);
4988 system_freezable_wq = alloc_workqueue("events_freezable", 4992 system_freezable_wq = alloc_workqueue("events_freezable",
4989 WQ_FREEZABLE, 0); 4993 WQ_FREEZABLE, 0);
4994 system_power_efficient_wq = alloc_workqueue("events_power_efficient",
4995 WQ_POWER_EFFICIENT, 0);
4996 system_freezable_power_efficient_wq = alloc_workqueue("events_freezable_power_efficient",
4997 WQ_FREEZABLE | WQ_POWER_EFFICIENT,
4998 0);
4990 BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq || 4999 BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq ||
4991 !system_unbound_wq || !system_freezable_wq); 5000 !system_unbound_wq || !system_freezable_wq ||
5001 !system_power_efficient_wq ||
5002 !system_freezable_power_efficient_wq);
4992 return 0; 5003 return 0;
4993} 5004}
4994early_initcall(init_workqueues); 5005early_initcall(init_workqueues);