Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp519773imm; Wed, 20 Jun 2018 02:08:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJLVhoB8cWxqlrLo/NT1IyslZx8ngWqLyaCfLtN2BFtsiet/xewH7m+HoBSpijtXyWG7UXU X-Received: by 2002:a17:902:b48f:: with SMTP id y15-v6mr22838192plr.261.1529485692148; Wed, 20 Jun 2018 02:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529485692; cv=none; d=google.com; s=arc-20160816; b=qhKQotH1yTRO1kr4o1oNiM0LAA+5xTA3ByyDpFULKs8R71+suTo8ZHYVvi1iQu0rio nrhlPafIj9D5NpUMrTFBe9JlhxG1GuuljDTAg2t0M+txI5D5fdtqy7UxjTsgTJO0KB92 KwWEq8zBRolZWXr1ifT0QKbqgV4WjJC+MAXmn17jVnsFmjW3ar/r6ei19f/RmHItp4iv XiIcX0lRmN6gXY2HHXjdpaswNAU9SI5vPp/nzXX9HF59cNUobfA69Jg8NpN/kkHUL0iv /G1vqKS/6z4j53Xs+g/vHrImkTChe2SVF2xkXyMQ/7NK+gOO/9UlwjrQ+/svW15sEETU 9Uow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yvRvZCzZdxAOy6t6mJI1JJ0j6J/j2TPsosQKePggfx0=; b=uKcnQR636h+HnYs59Tp1sgJUCfwHRW3eygg+5DXQunQIPSPS2oztlslUtSo+jDZLin AULHjY031T44tzOeUdRC5i9l2KBYsqp5eHky5yG8VhURVbjVfQGFoTBQeyH9t6U2hHyY RZy0LinCo8JVeKvF0gtZ3nUzrSlPZx2ufI+Et9iD65dShYnH+o073GVjYS54THFIQmja icS/5AU3Z+lgpaXTiCiRViFeEeFFDIS9WS+DAbwa2VogYPL9cM6fWbkWOJicAr71Cdip nEdZ2TiPL0Ua2Pu5NkKrHsdl+Nm2TwHKsUrKzr8C6Vd54D6Pkf39SHTQy4aOCvB0/ww4 RCdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si1657664pgn.178.2018.06.20.02.07.58; Wed, 20 Jun 2018 02:08:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932597AbeFTJHO (ORCPT + 99 others); Wed, 20 Jun 2018 05:07:14 -0400 Received: from foss.arm.com ([217.140.101.70]:34050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754826AbeFTJGy (ORCPT ); Wed, 20 Jun 2018 05:06:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 55E0480D; Wed, 20 Jun 2018 02:06:54 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (e105550-lin.cambridge.arm.com [10.1.211.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AF8D73F246; Wed, 20 Jun 2018 02:06:52 -0700 (PDT) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, gaku.inami.xh@renesas.com, linux-kernel@vger.kernel.org, Chris Redpath , Morten Rasmussen Subject: [PATCHv3 9/9] sched/fair: Don't move tasks to lower capacity cpus unless necessary Date: Wed, 20 Jun 2018 10:05:49 +0100 Message-Id: <1529485549-5191-10-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529485549-5191-1-git-send-email-morten.rasmussen@arm.com> References: <1529485549-5191-1-git-send-email-morten.rasmussen@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Redpath When lower capacity CPUs are load balancing and considering to pull something from a higher capacity group, we should not pull tasks from a cpu with only one task running as this is guaranteed to impede progress for that task. If there is more than one task running, load balance in the higher capacity group would have already made any possible moves to resolve imbalance and we should make better use of system compute capacity by moving a task if we still have more than one running. cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Chris Redpath Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index aac7b9155bc4..5d612d3906d5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8796,6 +8796,17 @@ static struct rq *find_busiest_queue(struct lb_env *env, capacity = capacity_of(i); + /* + * For ASYM_CPUCAPACITY domains, don't pick a cpu that could + * eventually lead to active_balancing high->low capacity. + * Higher per-cpu capacity is considered better than balancing + * average load. + */ + if (env->sd->flags & SD_ASYM_CPUCAPACITY && + capacity_of(env->dst_cpu) < capacity && + rq->nr_running == 1) + continue; + wl = weighted_cpuload(rq); /* -- 2.7.4