From patchwork Wed Apr 24 11:42:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16375 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7519623918 for ; Wed, 24 Apr 2013 11:47:44 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id ox1sf1315411veb.7 for ; Wed, 24 Apr 2013 04:46:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=d+fXWnxa6Gx7IPIshpDO/xjkXhL2mNQ4hVL1CtVowrM=; b=j/L91HSSqqzvsLqc2QvkwQFRWEAGje7eak6SmAT3z927CWH+icwpv7hGQHjBy0tfZn VumIfJ3NliL+uip8L6WvtAbEdCUnqJ4phorhLI9AAXc0Eizzwv1nlRX/avaC26T+N2Oj nu5nQhououtkT4OgFGIG9xwH32Oy/ox8NEIYUBuAMZe+C4AwgAJhJfdzYR9xnnncG7T/ jXhrmEewHnB6HgG/6x0R6F0YYBnDLs6qZFeiHGQ4Fdc4vUR/e97w3X/8oZUAgVv3cfgW Bm3hujS+ydAILcv9CNT0btQ+17+uQv6k69Q2DwUwgQmPXggcml9fWI3TsBy0LZAuiqYo PG6g== X-Received: by 10.224.58.77 with SMTP id f13mr24647392qah.7.1366804013323; Wed, 24 Apr 2013 04:46:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.18 with SMTP id y18ls785001qef.5.gmail; Wed, 24 Apr 2013 04:46:53 -0700 (PDT) X-Received: by 10.58.11.133 with SMTP id q5mr24922268veb.47.1366804013147; Wed, 24 Apr 2013 04:46:53 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id j11si1086311vcw.51.2013.04.24.04.46.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 04:46:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ha11so1640642vcb.16 for ; Wed, 24 Apr 2013 04:46:53 -0700 (PDT) X-Received: by 10.58.181.201 with SMTP id dy9mr25111053vec.34.1366804013052; Wed, 24 Apr 2013 04:46:53 -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.58.127.98 with SMTP id nf2csp169542veb; Wed, 24 Apr 2013 04:46:52 -0700 (PDT) X-Received: by 10.68.43.227 with SMTP id z3mr47403885pbl.217.1366804011995; Wed, 24 Apr 2013 04:46:51 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id uh1si2645098pab.239.2013.04.24.04.46.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 04:46:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id bi5so1137922pad.17 for ; Wed, 24 Apr 2013 04:46:51 -0700 (PDT) X-Received: by 10.66.159.234 with SMTP id xf10mr18874122pab.203.1366804011522; Wed, 24 Apr 2013 04:46:51 -0700 (PDT) Received: from localhost ([122.172.242.146]) by mx.google.com with ESMTPSA id wi6sm2769151pbc.22.2013.04.24.04.46.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 24 Apr 2013 04:46:50 -0700 (PDT) From: Viresh Kumar To: tj@kernel.org 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, Viresh Kumar , netdev@vger.kernel.org Subject: [PATCH V5 3/5] PHYLIB: queue work on system_power_efficient_wq Date: Wed, 24 Apr 2013 17:12:55 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlY1cDDaSEFBAxL0PY/4Spg+TVn2rrnukjSPcGpdrk2Acuy1wSQv5o6uPUZ8GHjhWYczaPW X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 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: , Phylib uses workqueues for multiple purposes. There is no real dependency of scheduling these on the cpu which scheduled them. On a idle system, it is observed that and 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 system_wq with system_power_efficient_wq for PHYLIB. Cc: David S. Miller Cc: netdev@vger.kernel.org Signed-off-by: Viresh Kumar Acked-by: David S. Miller --- drivers/net/phy/phy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c14f147..984c0b5 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -439,7 +439,7 @@ void phy_start_machine(struct phy_device *phydev, { phydev->adjust_state = handler; - schedule_delayed_work(&phydev->state_queue, HZ); + queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, HZ); } /** @@ -500,7 +500,7 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat) disable_irq_nosync(irq); atomic_inc(&phydev->irq_disable); - schedule_work(&phydev->phy_queue); + queue_work(system_power_efficient_wq, &phydev->phy_queue); return IRQ_HANDLED; } @@ -655,7 +655,7 @@ static void phy_change(struct work_struct *work) /* reschedule state queue work to run as soon as possible */ cancel_delayed_work_sync(&phydev->state_queue); - schedule_delayed_work(&phydev->state_queue, 0); + queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, 0); return; @@ -918,7 +918,8 @@ void phy_state_machine(struct work_struct *work) if (err < 0) phy_error(phydev); - schedule_delayed_work(&phydev->state_queue, PHY_STATE_TIME * HZ); + queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, + PHY_STATE_TIME * HZ); } static inline void mmd_phy_indirect(struct mii_bus *bus, int prtad, int devad,