From patchwork Mon Mar 18 15:23:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15405 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 CDD4A23E3E for ; Mon, 18 Mar 2013 15:24:50 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 78701A196D6 for ; Mon, 18 Mar 2013 15:24:50 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so3534870vbn.0 for ; Mon, 18 Mar 2013 08:24:50 -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=I3HYOADlcUjDzvIx81r9t4berb6Wl96pAmsQHDwfTS8=; b=IvwjUSE5vK9predl+6t3faf1YCnHbyDYRzPHRcno+9vX2uJ5pEQq+/A9VOuq0o6Dnd 3AGVy9LCVIlM2rPBIDGepd5dT9lUcOK9wc5kl8FLuJgPBOaIXcxPgcpki7KcmJBwIKwD y7VXnAohk2sWTygYnepmp4TBVyJVe/wlPFZixqlqpydCF2Y4pYRGs7KDlK9hVXwYhi5C WG4kX6Bz5SvcLXTqrtZMog0krn+yxAAP4TVjggCZCBbItY29Gp07wLD6N+m2hB1itu5s RH2ZWlCJTc5ixV6JibDUfQVIw0UvoXJbh7+7x4uh1pO4gL86d3mjuEPvq9uCGKIW4NM+ SOBA== X-Received: by 10.52.177.163 with SMTP id cr3mr17617721vdc.94.1363620289949; Mon, 18 Mar 2013 08:24:49 -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.58.127.98 with SMTP id nf2csp29032veb; Mon, 18 Mar 2013 08:24:49 -0700 (PDT) X-Received: by 10.66.190.104 with SMTP id gp8mr11306249pac.84.1363620288860; Mon, 18 Mar 2013 08:24:48 -0700 (PDT) Received: from mail-da0-x231.google.com (mail-da0-x231.google.com [2607:f8b0:400e:c00::231]) by mx.google.com with ESMTPS id iw4si7059130pac.211.2013.03.18.08.24.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:24:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::231 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c00::231; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400e:c00::231 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-da0-f49.google.com with SMTP id t11so1390820daj.22 for ; Mon, 18 Mar 2013 08:24:48 -0700 (PDT) X-Received: by 10.68.212.170 with SMTP id nl10mr34057673pbc.39.1363620288280; Mon, 18 Mar 2013 08:24:48 -0700 (PDT) Received: from localhost ([122.167.69.232]) by mx.google.com with ESMTPS id m18sm8598082pad.17.2013.03.18.08.24.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:24:47 -0700 (PDT) From: Viresh Kumar To: pjt@google.com, paul.mckenney@linaro.org, tglx@linutronix.de, tj@kernel.org, suresh.b.siddha@intel.com, venki@google.com, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org Cc: linaro-kernel@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, Arvind.Chauhan@arm.com, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , Chris Ball , linux-mmc@vger.kernel.org Subject: [PATCH V3 5/7] mmc: queue work on any cpu Date: Mon, 18 Mar 2013 20:53:27 +0530 Message-Id: <08070dbf56439c84b8c25837c2049ff8e8eafd6e.1363617402.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: ALoCoQkXipVPXJq655T3ZZBacxCNuUMmUOZ47keDYbapac+qWlS+05kIjFo/16yzlXmWVF2QHtb/ mmc uses workqueues for running mmc_rescan(). 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 isn't idle to save on power. By idle cpu (from scheduler's perspective) we mean: - Current task is idle task - nr_running == 0 - wake_list is empty This patch replaces the queue_delayed_work() with queue_delayed_work_on_any_cpu() siblings. This routine would look for the closest (via scheduling domains) non-idle cpu (non-idle from schedulers perspective). If the current cpu is not idle or all cpus are idle, work will be scheduled on local cpu. Cc: Chris Ball Cc: linux-mmc@vger.kernel.org Signed-off-by: Viresh Kumar --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 9290bb5..adf331a 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -85,7 +85,7 @@ MODULE_PARM_DESC( static int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay) { - return queue_delayed_work(workqueue, work, delay); + return queue_delayed_work_on_any_cpu(workqueue, work, delay); } /*