From patchwork Sun Mar 31 14:27:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15779 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AA50323E33 for ; Sun, 31 Mar 2013 14:27:27 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 537CDA18D2C for ; Sun, 31 Mar 2013 14:27:27 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id ox1so1784008veb.21 for ; Sun, 31 Mar 2013 07:27:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state; bh=hb64zoIHTOkFHvoXcsvRG+kAcA27PDMwJkdhq4uPank=; b=Quj4Yxk2PJYuS1Ha30our782K28HMrq15UBv0Nko99279i6fkYeLJxgC83dhpsF5BQ mS2MOKTOdoYPD7skymtVAQkmItL7MBT2qlywliEnwfnzfK5UFSlR6dFCPmb31gxRSuU2 Alci/mq5VWCLFpNK7gRjc/0hIU4CyFYrE88UO9HIbdjVq65L5xBhBj4N8N21RrXW56xw 2sx3o2AosV3MO9C0Tgujc1SGFl7h9xsItWOGcbDNWLGfgXVeURJyG8ZSfydVAXJ5rp0L jU1rt5fTu2gl0yPCwIloftqW4AwyxFg9nTG08TjZDMceL/vw7BvKy9wPZ92GlrdFuxto 2Pew== X-Received: by 10.220.106.14 with SMTP id v14mr6841802vco.2.1364740046843; Sun, 31 Mar 2013 07:27:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp51736ved; Sun, 31 Mar 2013 07:27:26 -0700 (PDT) X-Received: by 10.66.255.99 with SMTP id ap3mr14701651pad.102.1364740045969; Sun, 31 Mar 2013 07:27:25 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id ui2si10639558pab.320.2013.03.31.07.27.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:27:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) smtp.mail=viresh.kumar@linaro.org Received: by mail-pb0-f51.google.com with SMTP id rr4so826958pbb.38 for ; Sun, 31 Mar 2013 07:27:25 -0700 (PDT) X-Received: by 10.66.119.202 with SMTP id kw10mr14394614pab.181.1364740045388; Sun, 31 Mar 2013 07:27:25 -0700 (PDT) Received: from localhost ([122.167.73.68]) by mx.google.com with ESMTPS id ux10sm11421809pab.1.2013.03.31.07.27.20 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:27:24 -0700 (PDT) From: Viresh Kumar To: tj@kernel.org Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, davem@davemloft.net, airlied@redhat.com, axboe@kernel.dk, Viresh Kumar Subject: [PATCH V4 1/4] workqueue: Add system wide system_freezable_unbound_wq Date: Sun, 31 Mar 2013 19:57:02 +0530 Message-Id: <147bfb5aa81790f94df75858bf20570cbacc9dca.1364739015.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlrY4QfuHs8OmZAqnKQ7vbgnGvdAXRDL5cFO66UTf3xYOlQCnq8LOLZLokjSi2/KvkU04I4 This patch adds system wide system_freezable_unbound_wq which will be used by code that currently uses system_freezable_wq and can be moved to unbound workqueues. Signed-off-by: Viresh Kumar --- include/linux/workqueue.h | 4 ++++ kernel/workqueue.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 835d12b..ab7597b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -325,11 +325,15 @@ enum { * * system_freezable_wq is equivalent to system_wq except that it's * freezable. + * + * system_freezable_unbound_wq is equivalent to system_unbound_wq except that + * it's freezable. */ 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_freezable_unbound_wq; static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) { diff --git a/kernel/workqueue.c b/kernel/workqueue.c index df2f6c4..771a5cc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -281,6 +281,8 @@ 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_freezable_unbound_wq __read_mostly; +EXPORT_SYMBOL_GPL(system_freezable_unbound_wq); static int worker_thread(void *__worker); static void copy_workqueue_attrs(struct workqueue_attrs *to, @@ -4467,8 +4469,11 @@ static int __init init_workqueues(void) WQ_UNBOUND_MAX_ACTIVE); system_freezable_wq = alloc_workqueue("events_freezable", WQ_FREEZABLE, 0); + system_freezable_unbound_wq = alloc_workqueue("events_unbound_freezable", + WQ_FREEZABLE | WQ_UNBOUND, 0); BUG_ON(!system_wq || !system_highpri_wq || !system_long_wq || - !system_unbound_wq || !system_freezable_wq); + !system_unbound_wq || !system_freezable_wq || + !system_freezable_unbound_wq); return 0; } early_initcall(init_workqueues);