From patchwork Wed Jan 22 06:53:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 23483 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF3ED218DC for ; Wed, 22 Jan 2014 06:54:27 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id up15sf21135559pbc.7 for ; Tue, 21 Jan 2014 22:54:26 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=urbjscDxjXK9EWTZlOGWNKw50T5a2RqcXLANlvdASmg=; b=XDj12rJ2TtDchOTeVvqsp7xRgtO4rs1GbULAEFeXattU7H59OijD3J40jmtW3C4M0C eA7TpL1xgGQC8tiah9ZUcSlkPia+/7rh0Ssz7x6BaIQ+KuKcOG4FH5Xvg/vseoyw6CYh zMv5FVJRAHCjeyggn3GvMqXeJHdeD0YL7mxJRlpiiN0IMlBOYN9k0sJoCBFtjgSHov0J 0BqGwlWorJu6xC8E7L1tyNiKN/WDCzupcuiIaFrL/DMWGd26OYi75HqPvnyuLN7z05Ys EjXZiI0T96CXWOPeRiroSsAeTpWnupQva9/Yebb+Bk0QL1W4qrZ1HZYsoWqlDB1w9Npa 2VIQ== X-Gm-Message-State: ALoCoQk0VJLR1XOlyAmQTpT8boIgQ1IDY6NAEb5jYdidmLMW1HlO6k3wmh7RUbX07gmY72jeVe8l X-Received: by 10.66.218.70 with SMTP id pe6mr10680229pac.33.1390373666907; Tue, 21 Jan 2014 22:54:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.105 with SMTP id j9ls2215035qej.94.gmail; Tue, 21 Jan 2014 22:54:26 -0800 (PST) X-Received: by 10.58.229.164 with SMTP id sr4mr15976842vec.18.1390373666734; Tue, 21 Jan 2014 22:54:26 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id a2si3920086vea.105.2014.01.21.22.54.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id f12so3046968vbg.17 for ; Tue, 21 Jan 2014 22:54:26 -0800 (PST) X-Received: by 10.58.106.70 with SMTP id gs6mr4216940veb.28.1390373666655; Tue, 21 Jan 2014 22:54:26 -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 u4csp165267vcz; Tue, 21 Jan 2014 22:54:25 -0800 (PST) X-Received: by 10.180.107.1 with SMTP id gy1mr1305307wib.47.1390373665299; Tue, 21 Jan 2014 22:54:25 -0800 (PST) Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by mx.google.com with ESMTPS id 18si5469959wjo.128.2014.01.21.22.54.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:25 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=74.125.82.179; Received: by mail-we0-f179.google.com with SMTP id w62so9018566wes.10 for ; Tue, 21 Jan 2014 22:54:24 -0800 (PST) X-Received: by 10.194.22.230 with SMTP id h6mr17357wjf.86.1390373664843; Tue, 21 Jan 2014 22:54:24 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id q15sm12716260wjw.18.2014.01.21.22.54.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Jan 2014 22:54:23 -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 1/2] net/ipv4: queue work on power efficient wq Date: Wed, 22 Jan 2014 12:23:32 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e 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.212.44 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 ipv4 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 --- Initial support for power-efficient workqueues was added here: https://lkml.org/lkml/2013/4/24/215 net/ipv4/devinet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 646023b..ac2dff3 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -474,7 +474,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh, inet_hash_insert(dev_net(in_dev->dev), ifa); cancel_delayed_work(&check_lifetime_work); - schedule_delayed_work(&check_lifetime_work, 0); + queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0); /* Send message first, then call notifier. Notifier will trigger FIB update, so that @@ -684,7 +684,8 @@ static void check_lifetime(struct work_struct *work) if (time_before(next_sched, now + ADDRCONF_TIMER_FUZZ_MAX)) next_sched = now + ADDRCONF_TIMER_FUZZ_MAX; - schedule_delayed_work(&check_lifetime_work, next_sched - now); + queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, + next_sched - now); } static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft, @@ -842,7 +843,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) ifa = ifa_existing; set_ifa_lifetime(ifa, valid_lft, prefered_lft); cancel_delayed_work(&check_lifetime_work); - schedule_delayed_work(&check_lifetime_work, 0); + queue_delayed_work(system_power_efficient_wq, + &check_lifetime_work, 0); rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid); blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa); } @@ -2322,7 +2324,7 @@ void __init devinet_init(void) register_gifconf(PF_INET, inet_gifconf); register_netdevice_notifier(&ip_netdev_notifier); - schedule_delayed_work(&check_lifetime_work, 0); + queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0); rtnl_af_register(&inet_af_ops);