From patchwork Wed Jan 22 06:53:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 23484 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f200.google.com (mail-yk0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2168A218DC for ; Wed, 22 Jan 2014 06:54:33 +0000 (UTC) Received: by mail-yk0-f200.google.com with SMTP id 200sf17973569ykr.3 for ; Tue, 21 Jan 2014 22:54:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=JTAgfXd8lt6TUc6aeJiC5M2EGaAR7L8i9bwe0BTmu1Y=; b=LNnnSSr1GIVBVvAq2Cugv190/dygXx6DwYlkUDsdpPGU7Ooz3XkPW3hC0BbNVIQcSE 6grHagMsczvnfH5zWWSSBlfnTS2y5NBMgbM/f9M+Zmj0KuViJmvYzVSwO2pX1817gRR+ V9zpO+Jpl+/H/pMja7Bn+ZO01aXK6KRdjtGuIQ9gfmXtA28/naev4O2VoHtaxsD3lHnO DEzQzFO4gwBa1fE+Ra3JIhh1x8wbna2oEzSwFyewqBzMx0EhffbOqmaVNJuNxt0Vuceq /cSgZxcXtV5Q7anQ59KDFzqfi7MGysHPp207b+k1is3KcQFFhsYv6dtBbSlPyZz12i3L KFUA== X-Gm-Message-State: ALoCoQnzd7Tc/ozEw34RZjWlrfdqybdXIAay9i+wxEgyPDBM2mUVm2HWlBLgtqwIRQc5XYwflhT7 X-Received: by 10.236.86.77 with SMTP id v53mr9593576yhe.41.1390373672361; Tue, 21 Jan 2014 22:54:32 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.102 with SMTP id l93ls1478626qge.93.gmail; Tue, 21 Jan 2014 22:54:32 -0800 (PST) X-Received: by 10.58.132.203 with SMTP id ow11mr17341782veb.1.1390373672251; Tue, 21 Jan 2014 22:54:32 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id gq1si3925915vec.61.2014.01.21.22.54.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ie18so4050409vcb.40 for ; Tue, 21 Jan 2014 22:54:32 -0800 (PST) X-Received: by 10.220.193.132 with SMTP id du4mr69645vcb.39.1390373672173; Tue, 21 Jan 2014 22:54:32 -0800 (PST) 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.174.196 with SMTP id u4csp165270vcz; Tue, 21 Jan 2014 22:54:31 -0800 (PST) X-Received: by 10.180.91.164 with SMTP id cf4mr17971850wib.2.1390373670871; Tue, 21 Jan 2014 22:54:30 -0800 (PST) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by mx.google.com with ESMTPS id lp10si5488324wjb.12.2014.01.21.22.54.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:30 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=74.125.82.41; Received: by mail-wg0-f41.google.com with SMTP id n12so5709918wgh.4 for ; Tue, 21 Jan 2014 22:54:30 -0800 (PST) X-Received: by 10.180.21.166 with SMTP id w6mr17848618wie.31.1390373670393; Tue, 21 Jan 2014 22:54:30 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id ay6sm12717432wjb.23.2014.01.21.22.54.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:29 -0800 (PST) From: Viresh Kumar To: davem@davemloft.net Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 2/2] net/neighbour: queue work on power efficient wq Date: Wed, 22 Jan 2014 12:23:33 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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 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: , Workqueue used in neighbour layer have no real dependency of scheduling these on the cpu which scheduled them. On a idle system, it is observed that an idle cpu wakes up many times just to service this work. It would be better if we can schedule it on a cpu which the scheduler believes to be the most appropriate one. This patch replaces normal workqueues with power efficient versions. This doesn't change existing behavior of code unless CONFIG_WQ_POWER_EFFICIENT is enabled. Signed-off-by: Viresh Kumar --- net/core/neighbour.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index f8012fe..b9e9e0d 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -828,7 +828,7 @@ out: * ARP entry timeouts range from 1/2 BASE_REACHABLE_TIME to 3/2 * BASE_REACHABLE_TIME. */ - schedule_delayed_work(&tbl->gc_work, + queue_delayed_work(system_power_efficient_wq, &tbl->gc_work, NEIGH_VAR(&tbl->parms, BASE_REACHABLE_TIME) >> 1); write_unlock_bh(&tbl->lock); } @@ -1565,7 +1565,8 @@ static void neigh_table_init_no_netlink(struct neigh_table *tbl) rwlock_init(&tbl->lock); INIT_DEFERRABLE_WORK(&tbl->gc_work, neigh_periodic_work); - schedule_delayed_work(&tbl->gc_work, tbl->parms.reachable_time); + queue_delayed_work(system_power_efficient_wq, &tbl->gc_work, + tbl->parms.reachable_time); setup_timer(&tbl->proxy_timer, neigh_proxy_process, (unsigned long)tbl); skb_queue_head_init_class(&tbl->proxy_queue, &neigh_table_proxy_queue_class);