From patchwork Tue May 14 17:56:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 16905 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3ACB825D00 for ; Tue, 14 May 2013 17:57:25 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id l18sf727303wgh.4 for ; Tue, 14 May 2013 10:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=6/Scy/ms3Kr7o8kwZBMOB/TsQU/6JuNMjbLxHviC7jM=; b=EGk1e99dqxEdpVqf6z2cuGCdWCs8xWz8ESreV/ioBrE/Oryp77JJ4Cw0d+kmFu/qzM I15ULL0TJhtvXIqR2FT+QF9vswcVlXjaFiin4AciK+AQZOUcdalwLGQcwITrWv3XaqDR 2OEJg/y+ZGseSwMVS6dQjv2awq6MHE88BZfJPBDbRySSRl6o+fO0JrkbGmKThQG+cStz geXC/pql1BB3/s2xA6eDyjjWGt1Ks21pZ60JNqJi/Wz+Lr1WC07tnC+KO7EqtcWLmFDD ygev7NEgvPnqd9+wsYq+Uo4VdyvCjdyh3YLSKG5A8hHW1P4ejjzM1YjBgvKafjvRx8gR B5ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:in-reply-to:user-agent:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe:content-type:content-disposition; bh=6/Scy/ms3Kr7o8kwZBMOB/TsQU/6JuNMjbLxHviC7jM=; b=iPrBSGiEKPXDPqstBYZ+NB4/gdaWTG4fKNDGVCFlx+4KD7ULmyA7MuqrKMrNMlEz13 lBfxMgFw0lV67RXvsIDJmrga1pOX4rwjkPH3KbkQxxSB2qQ2Hy6z9oK9G6kO6KKjgRdF F5hV9jK3pHhjBQnpY0qXuEP4wugSSE9TXdogIgewyd0HVgY8pEOnwRfBQlt9f+OFZU4H Aal2PrGck15HvDS8ut1IwephQpvsU6fr21ysxf8kDnRi3zZ+rQuqMb2GUiB1jXXA6Dgt +zFbeeXAa2YKk1NeoOt0Z38T+6nVJNKnx4y5jAT3lGt8HRGDsEPJx9Jq0GbOdFzLLjmZ ZEkg== X-Received: by 10.180.109.111 with SMTP id hr15mr1256802wib.1.1368554209638; Tue, 14 May 2013 10:56:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.86.103 with SMTP id o7ls284627wiz.45.gmail; Tue, 14 May 2013 10:56:49 -0700 (PDT) X-Received: by 10.180.74.172 with SMTP id u12mr8945530wiv.0.1368554209556; Tue, 14 May 2013 10:56:49 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id jf19si5887240wic.33.2013.05.14.10.56.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 May 2013 10:56:49 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::236; Received: by mail-ve0-f182.google.com with SMTP id da11so1003371veb.13 for ; Tue, 14 May 2013 10:56:48 -0700 (PDT) X-Received: by 10.58.144.231 with SMTP id sp7mr22572558veb.34.1368554208365; Tue, 14 May 2013 10:56:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp73241vcb; Tue, 14 May 2013 10:56:47 -0700 (PDT) X-Received: by 10.236.74.101 with SMTP id w65mr6182000yhd.21.1368554207642; Tue, 14 May 2013 10:56:47 -0700 (PDT) Received: from mail-gg0-x22b.google.com (mail-gg0-x22b.google.com [2607:f8b0:4002:c02::22b]) by mx.google.com with ESMTPS id r23si7636626yhl.177.2013.05.14.10.56.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 May 2013 10:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of htejun@gmail.com designates 2607:f8b0:4002:c02::22b as permitted sender) client-ip=2607:f8b0:4002:c02::22b; Received: by mail-gg0-f171.google.com with SMTP id h13so149287ggd.2 for ; Tue, 14 May 2013 10:56:47 -0700 (PDT) X-Received: by 10.236.43.197 with SMTP id l45mr18415781yhb.51.1368554207333; Tue, 14 May 2013 10:56:47 -0700 (PDT) Received: from mtj.dyndns.org (nat-pool-3-rdu.redhat.com. [66.187.233.203]) by mx.google.com with ESMTPSA id j64sm7918649yhj.25.2013.05.14.10.56.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 May 2013 10:56:46 -0700 (PDT) Sender: Tejun Heo Date: Tue, 14 May 2013 10:56:40 -0700 From: Tejun Heo To: Viresh Kumar Cc: davem@davemloft.net, airlied@redhat.com, axboe@kernel.dk, tglx@linutronix.de, peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, linaro-kernel@lists.linaro.org, patches@linaro.org Subject: Re: [PATCH V5 2/5] workqueue: Add system wide power_efficient workqueues Message-ID: <20130514175640.GI6795@mtj.dyndns.org> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQlYw6Bv/Bj2zJTNLaYgrI0FyzuzXsV8DsegSNSTZlkdnZbTaAkWRIUiMYvNn44zPrwhO592 X-Original-Sender: tj@kernel.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline This one is slightly updated too. The rest remain the same. >From 0668106ca3865ba945e155097fb042bf66d364d3 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 24 Apr 2013 17:12:54 +0530 Subject: 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 Signed-off-by: Tejun Heo --- include/linux/workqueue.h | 8 ++++++++ kernel/workqueue.c | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index fc0136b..a9f4119 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -360,11 +360,19 @@ enum { * * system_freezable_wq is equivalent to system_wq except that it's * freezable. + * + * *_power_efficient_wq are inclined towards saving power and converted + * into WQ_UNBOUND variants if 'wq_power_efficient' is enabled; otherwise, + * they are same as their non-power-efficient counterparts - e.g. + * system_power_efficient_wq is identical to system_wq if + * 'wq_power_efficient' is disabled. See WQ_POWER_EFFICIENT for more info. */ extern struct workqueue_struct *system_wq; extern struct workqueue_struct *system_long_wq; extern struct workqueue_struct *system_unbound_wq; extern struct workqueue_struct *system_freezable_wq; +extern struct workqueue_struct *system_power_efficient_wq; +extern struct workqueue_struct *system_freezable_power_efficient_wq; static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) { diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 8068d97..16ca2d3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -314,6 +314,10 @@ struct workqueue_struct *system_unbound_wq __read_mostly; EXPORT_SYMBOL_GPL(system_unbound_wq); struct workqueue_struct *system_freezable_wq __read_mostly; EXPORT_SYMBOL_GPL(system_freezable_wq); +struct workqueue_struct *system_power_efficient_wq __read_mostly; +EXPORT_SYMBOL_GPL(system_power_efficient_wq); +struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly; +EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq); static int worker_thread(void *__worker); static void copy_workqueue_attrs(struct workqueue_attrs *to, @@ -4987,8 +4991,15 @@ static int __init init_workqueues(void) WQ_UNBOUND_MAX_ACTIVE); system_freezable_wq = alloc_workqueue("events_freezable", WQ_FREEZABLE, 0); + system_power_efficient_wq = alloc_workqueue("events_power_efficient", + WQ_POWER_EFFICIENT, 0); + system_freezable_power_efficient_wq = alloc_workqueue("events_freezable_power_efficient", + WQ_FREEZABLE | WQ_POWER_EFFICIENT, + 0); BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq || - !system_unbound_wq || !system_freezable_wq); + !system_unbound_wq || !system_freezable_wq || + !system_power_efficient_wq || + !system_freezable_power_efficient_wq); return 0; } early_initcall(init_workqueues);