From patchwork Thu Apr 25 17:23:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 2489511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 2415FDF5B1 for ; Thu, 25 Apr 2013 18:18:25 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPyP-0001ya-5w; Thu, 25 Apr 2013 17:28:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPwc-0006vj-K8; Thu, 25 Apr 2013 17:26:54 +0000 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPv2-0006ky-02 for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2013 17:25:33 +0000 Received: by mail-wi0-f170.google.com with SMTP id l13so9504686wie.5 for ; Thu, 25 Apr 2013 10:25:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=x7wfDxOcOYEBt/H3NpniUwnlyeqvuFgtizn2bXXoxXA=; b=KOw6SnfemLLbYz4pcM5nXuVWxyRJ+RHjxXFLCCQXrC5yDa+tWWEQH5vg6Fdhh72gMT o8WJS5FsPXFyC4bVtaZNXuqCd2EafC7upJDK9ajKa3QPNMs7jEf8X50yM2KasSi/ITZW BHHDHNIDI5r7HA8DIcdgE3mfB5QtnakNAKm5QPjPZrrAtEDUVC8UPN/Y37kCOnmdknUd 0Y43Hd/zdEKGid5G4ztWL7hkMJ/OMNXuzug5WSBxt+qXVVWMuIbEoX33flWMrgIeWPUx ygIUPc98T71rs5DXhsCUuqUA6qDnt2M+e09gAelkCoZvvf7er8yv88apgng/vE4v6ECD qFiA== X-Received: by 10.194.109.136 with SMTP id hs8mr77548624wjb.8.1366910712330; Thu, 25 Apr 2013 10:25:12 -0700 (PDT) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id q13sm12311485wie.8.2013.04.25.10.25.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:11 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, peterz@infradead.org, mingo@kernel.org, linux@arm.linux.org.uk, pjt@google.com, santosh.shilimkar@ti.com, Morten.Rasmussen@arm.com, chander.kashyap@linaro.org, cmetcalf@tilera.com, tony.luck@intel.com, alex.shi@intel.com, preeti@linux.vnet.ibm.com Subject: [PATCH 11/14] sched: filter task pull request Date: Thu, 25 Apr 2013 19:23:27 +0200 Message-Id: <1366910611-20048-12-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366910611-20048-1-git-send-email-vincent.guittot@linaro.org> References: <1366910611-20048-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQk7j52E3/+M6XvS9JVHmWAUjbVycbs7J1f+3cbS6KC07miYAVX3r+3ye4yK1A0ybNZ9cgaw X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130425_132516_252723_9082A191 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: len.brown@intel.com, l.majewski@samsung.com, Vincent Guittot , corbet@lwn.net, amit.kucheria@linaro.org, tglx@linutronix.de, paulmck@linux.vnet.ibm.com, arjan@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Only CPUs that participates to the packing effort can pull tasks on a busiest group. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 28f8ea7..6f63fb9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3494,6 +3494,12 @@ static bool is_buddy_full(int cpu) return (sum * 1024 >= period * 1000); } +static bool is_my_buddy(int cpu, int buddy) +{ + int my_buddy = per_cpu(sd_pack_buddy, cpu); + return (my_buddy == -1) || (buddy == my_buddy); +} + static bool is_light_task(struct task_struct *p) { /* A light task runs less than 20% in average */ @@ -4688,8 +4694,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, /* Bias balancing toward cpus of our domain */ if (local_group) { - if (idle_cpu(i) && !first_idle_cpu && - cpumask_test_cpu(i, sched_group_mask(group))) { + if (is_my_buddy(i, i) && idle_cpu(i) && !first_idle_cpu + && cpumask_test_cpu(i, sched_group_mask(group))) { first_idle_cpu = 1; balance_cpu = i; } @@ -4817,6 +4823,10 @@ static void update_plb_buddy(int cpu, int *balance, struct sd_lb_stats *sds, /* Get my new buddy */ buddy = per_cpu(sd_pack_buddy, cpu); + + /* This CPU doesn't act for agressive packing */ + if (buddy != cpu) + sds->busiest = 0; } /**