From patchwork Sun Mar 31 14:27:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15780 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 5E12F23E33 for ; Sun, 31 Mar 2013 14:27:35 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id 1A7FCA18D2C for ; Sun, 31 Mar 2013 14:27:35 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id lf10so1712363vcb.1 for ; Sun, 31 Mar 2013 07:27:34 -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=n2pK9NYhG01dUx5wTp6eIDGsif+QEnzPcBAlwAS0ymg=; b=EDmFJlG1qr7VF3bqcGft3ZeDVsMhttrbmmxifzVwxJSa2xPQqoNdv2vpJ9+EHQp4cg 6rpsjhy/1W11Z3ZskA1I/pGigFmujmVFCkXhKKUyhIRIHvSc+Rgt2geWINdvlM5SICmA gTmoD3t/Hpj1InKNS5fcNMB9YpV6M8hVg5kxzsM64swENMVtZF15aRAvjwypTlKykCPN FUcP4V/VwwTgc37jkacTcN7CR82/2WKPZDYyDwFMR8fgZpHpdtyzJiiuJChsHDrR2a6D 17YKobFGJwtA/upErT7xiUlxE69jLHeISEWtA919k/AMM8lF8k48BQ54TIb4dkcv1eDY BJbg== X-Received: by 10.58.29.101 with SMTP id j5mr6844517veh.26.1364740054526; Sun, 31 Mar 2013 07:27:34 -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 cg12csp51741ved; Sun, 31 Mar 2013 07:27:33 -0700 (PDT) X-Received: by 10.68.195.161 with SMTP id if1mr13530881pbc.207.1364740053612; Sun, 31 Mar 2013 07:27:33 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id iw4si10685202pac.182.2013.03.31.07.27.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:27:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.169; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.192.169 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-pd0-f169.google.com with SMTP id 10so859552pdc.0 for ; Sun, 31 Mar 2013 07:27:33 -0700 (PDT) X-Received: by 10.68.228.199 with SMTP id sk7mr13761035pbc.40.1364740053185; Sun, 31 Mar 2013 07:27:33 -0700 (PDT) Received: from localhost ([122.167.73.68]) by mx.google.com with ESMTPS id kl4sm10170206pbc.31.2013.03.31.07.27.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:27:32 -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 , netdev@vger.kernel.org Subject: [PATCH V4 2/4] PHYLIB: queue work on unbound wq Date: Sun, 31 Mar 2013 19:57:03 +0530 Message-Id: <6be4e9ad2048a2a9d60143f58931c3fe94770175.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: ALoCoQmEiIb2AAQmcfFKUOiNOI+pMG7zrTlzWDdxXIhlj5Q7t+Gerusy8a/zjxw0g98VmDQW1b8z 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_unbound_wq for PHYLIB. Cc: David S. Miller Cc: netdev@vger.kernel.org Signed-off-by: Viresh Kumar --- 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..b2fe180 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_unbound_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_unbound_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_unbound_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_unbound_wq, &phydev->state_queue, + PHY_STATE_TIME * HZ); } static inline void mmd_phy_indirect(struct mii_bus *bus, int prtad, int devad,