From patchwork Sun Mar 31 14:31:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15784 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 1044B23E33 for ; Sun, 31 Mar 2013 14:32:27 +0000 (UTC) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by fiordland.canonical.com (Postfix) with ESMTP id A9236A194C9 for ; Sun, 31 Mar 2013 14:32:26 +0000 (UTC) Received: by mail-vc0-f177.google.com with SMTP id ia10so1684447vcb.22 for ; Sun, 31 Mar 2013 07:32: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=n2pK9NYhG01dUx5wTp6eIDGsif+QEnzPcBAlwAS0ymg=; b=gC9CElAYbS9sjnO1ofKk0mteWAHHF3c4eQ/FYdDXJakwzl3zJWjdZb+Yt9diOg2u9z 9HwToUH8eKt0CrI+MqVeyTWu4gA5R5fp1zk4giX7MsqsPzIOCQFW4REqdxnRvtnC7PH3 6R7pKvJWDXA5JuNZFas1EUICbQQp6UZ9AijEgvVBmDoLuDE/6Co40j5pGjApGFiEOQdJ GkIKuqvEWbBpZ8k/OLWgqf/3/pE10NLVkinZ7L/Yde3hyFYmgp3E2CKmjUcSbCCSaMU8 SGc8elKHg/uVJVzIZHn1n1+jt6rWXtnSh+sv54zZZHuESiB9tKRJHWXeSABRyFi+bJDe XTPw== X-Received: by 10.52.20.239 with SMTP id q15mr5812983vde.73.1364740346218; Sun, 31 Mar 2013 07:32: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 cg12csp51853ved; Sun, 31 Mar 2013 07:32:25 -0700 (PDT) X-Received: by 10.66.228.167 with SMTP id sj7mr14495478pac.72.1364740345331; Sun, 31 Mar 2013 07:32:25 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id zz9si10056312pbc.359.2013.03.31.07.32.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:32:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 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-pa0-f52.google.com with SMTP id fb10so954605pad.39 for ; Sun, 31 Mar 2013 07:32:24 -0700 (PDT) X-Received: by 10.68.195.161 with SMTP id if1mr13548943pbc.207.1364740344789; Sun, 31 Mar 2013 07:32:24 -0700 (PDT) Received: from localhost ([122.167.73.68]) by mx.google.com with ESMTPS id xl10sm11392439pac.15.2013.03.31.07.32.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 07:32: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, tglx@linutronix.de, peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , netdev@vger.kernel.org Subject: [PATCH V4 2/4] PHYLIB: queue work on unbound wq Date: Sun, 31 Mar 2013 20:01:45 +0530 Message-Id: <6be4e9ad2048a2a9d60143f58931c3fe94770175.1364740180.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: ALoCoQlwSI+VUEXCDIk2Jkr0XeUf1B1uM5XNCZLJ04w5sGFs0VB2C/lI56xglg92v4z7/VV9givC 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 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..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,