From patchwork Sun Oct 7 07:43:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 1562111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id EF5D83FC1A for ; Sun, 7 Oct 2012 21:06:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TKy1K-00020s-8b; Sun, 07 Oct 2012 21:04:18 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TKlXW-0000cd-Ue for linux-arm-kernel@lists.infradead.org; Sun, 07 Oct 2012 07:44:44 +0000 Received: by mail-wg0-f49.google.com with SMTP id gg4so1823789wgb.18 for ; Sun, 07 Oct 2012 00:44:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=jRtP0/8FbFifqWUSNAPMd5FGCQEDn9fuDMEKy/pfZmQ=; b=NbXWNamnCGc0Cx/CQh9j8zmSGX2KWCXpVLRZB4zCLOqqDMZZcmIi4BHM53jcuAzagx eGSHO2cgDnIqQERKlOU0j/qEQsFIjI2WmM10beq5yBYCHSViG3vH9drL2ORLbtwJCgaL I8/zD8zHbbsevx2FklH7gQlGGQyVRImA7/9OrjV99mYJ91ogD7Geq0LAFrSIwdjiCdoY S0wguj7rPdcmsHwkDb3nArmhnTbyNZnigju9JiE09OluJTMgZFHMh3j0tCGWO/I4DiY8 nSbLbsFy5+LhC6D2mneQJnxJNx8gabS7A8WX8X70ZlmLBMMKJJgoQbOjxcfxQOxXF21k 82Gw== Received: by 10.180.80.100 with SMTP id q4mr520809wix.20.1349595882610; Sun, 07 Oct 2012 00:44:42 -0700 (PDT) Received: from lmenx30s.lme.st.com (pas72-1-88-161-60-229.fbx.proxad.net. [88.161.60.229]) by mx.google.com with ESMTPS id j8sm12495245wiy.9.2012.10.07.00.44.40 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Oct 2012 00:44:42 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, peterz@infradead.org, mingo@redhat.com, pjt@google.com, linux@arm.linux.org.uk Subject: [RFC 5/6] sched: pack the idle load balance Date: Sun, 7 Oct 2012 09:43:57 +0200 Message-Id: <1349595838-31274-6-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349595838-31274-1-git-send-email-vincent.guittot@linaro.org> References: <1349595838-31274-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQkMWMuvlJXrcaRxbkd467VTUf7IzwrSKsFdSj4pwVzI9chpO/AflxIp/X5qdhCXpprwvOq0 X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Sun, 07 Oct 2012 17:03:37 -0400 Cc: Vincent Guittot X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Look for an idle CPU close the pack buddy CPU whenever possible. The goal is to prevent the wake up of a CPU which doesn't share the power line of the pack CPU Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6df53b5..f76acdc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5158,7 +5158,25 @@ static struct { static inline int find_new_ilb(int call_cpu) { + struct sched_domain *sd; int ilb = cpumask_first(nohz.idle_cpus_mask); + int buddy = per_cpu(sd_pack_buddy, call_cpu); + + /* + * If we have a pack buddy CPU, we try to run load balance on a CPU + * that is close to the buddy. + */ + if (buddy != -1) + for_each_domain(buddy, sd) { + if (sd->flags & SD_SHARE_CPUPOWER) + continue; + + ilb = cpumask_first_and(sched_domain_span(sd), + nohz.idle_cpus_mask); + + if (ilb < nr_cpu_ids) + break; + } if (ilb < nr_cpu_ids && idle_cpu(ilb)) return ilb;