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: 16406 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C48AD23979 for ; Thu, 25 Apr 2013 17:26:07 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hf12sf5669278vcb.8 for ; Thu, 25 Apr 2013 10:25:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=x7wfDxOcOYEBt/H3NpniUwnlyeqvuFgtizn2bXXoxXA=; b=HAau+OjwImi+q6I6JBJrV9t+uq5oxQnz5c5actQhj7nPnyepJzfFeUtWhHWM618+GH IVIUnXjzPxgoYS8wUrrBghv+Lkv4St4OQMtDjnkm8jJd11asy+x6stZk+3diq98T+zLP PDfCrvZJgqBrcQQ+RCfAODhPx4ybDJDzIvb/2wAUcnpdPHtLfg22x706hGT6Ie1KsH1E Bn8TcMcXGiSJfRBYZx6g5NE50kMaLJj4J4OIod5Echj9me6E1iykEkES9mRLshhXWiqV dUrKwre9O67t2SCacCVxHaiIqR854bVss6rb5YfUNaYcOaVn3YfvJNqrb4f/m56L7LR4 K9lg== X-Received: by 10.224.88.200 with SMTP id b8mr27735247qam.8.1366910713947; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.111 with SMTP id nf15ls1456893qeb.25.gmail; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) X-Received: by 10.52.34.102 with SMTP id y6mr23389370vdi.19.1366910713660; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id ez9si3641287vdb.146.2013.04.25.10.25.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:13 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id p14so2870352vbm.18 for ; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) X-Received: by 10.58.144.170 with SMTP id sn10mr22655548veb.7.1366910713580; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp32672veb; Thu, 25 Apr 2013 10:25:13 -0700 (PDT) X-Received: by 10.181.11.196 with SMTP id ek4mr10950119wid.30.1366910712731; Thu, 25 Apr 2013 10:25:12 -0700 (PDT) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [2a00:1450:400c:c05::229]) by mx.google.com with ESMTPS id f9si2724535wie.113.2013.04.25.10.25.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:12 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::229 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=2a00:1450:400c:c05::229; Received: by mail-wi0-f169.google.com with SMTP id h11so9502796wiv.4 for ; Thu, 25 Apr 2013 10:25:12 -0700 (PDT) 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 Cc: paulmck@linux.vnet.ibm.com, tglx@linutronix.de, len.brown@intel.com, arjan@linux.intel.com, amit.kucheria@linaro.org, corbet@lwn.net, l.majewski@samsung.com, Vincent Guittot 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: ALoCoQmQTxzc8ev2vx5IRG5yN1cTQ43FbvnCa8CFhyeAh0CgECn/97f3JpDWjvOuKyuCZhhBZoq1 X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; } /**