Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2573480imm; Mon, 10 Sep 2018 03:20:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZDtKgEssOG6wcF18Kk0NjpRdkCI+YN+PPhkvz+ubGJpS4GYTkqNYyYMEKy4Clx02Vf4XCv X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr21829667pgi.306.1536574830343; Mon, 10 Sep 2018 03:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536574830; cv=none; d=google.com; s=arc-20160816; b=RNf0oq+W9VJ19QtLEvhC+4/k6jXVqGp2x02clM2MQ0qYH6mZksjCxtKbG3Bqs9U40M PjsipssJy0yjFDxA+46xC5/WsqmNnFoFsdVds/NpHh6w5/SPvoa7nlYfy8dqGxKTQXES 17qBh0LNPCngn/HGzZ9DOfav7mv5ygAhKS3EsSSk4F5KT/BSlMm1am6La82iRb6NEZfo JFw8ZKGOs6pTAVIvdy9fmXeXbdQVW2U65+/fRqOyfuHqmg0RnDAJje97QtQewVe8+kaN 5pQTlasd9lWmFRZqYg8rEOz+VgCO2odLtNgClsyj2+VvSznYv+0eLTZcDcqSCsWDt4Pz zyUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=ojE3WJZqReDMnlPfkqL8vpxT0Ih76/zTQgKlAJH2KKo=; b=TrIi7OXbIiHlZV+9BJU6+O0MoZhUZK2B3hXFFhZgzZ+vJgaLfIC9voSXd7mY1cJ1pX Zd1qARj+0tr0eA4wNOR1yMASkt1rbgYL1v70D6PjEFXkNkiBJOg1hiI0On6qW4+Ze2nP omZISA9FLUF2vKgkl9pzzhxDTalagSq/V5gnyzl+/UQrktfbXa8toq2VZj4MwWXvd+dv KVy8/HrWxneP3+fjEVkiFwEwL0HXHWKPEbnwAp5tthlWLAh/ObziYg1ROfwV/VzPdDoa UCUgbAMf+vq1+N278Ec4DBBCuSCxRnA3RvafR/EiWYBtt1hNjIGpp1L0RVW383Q+BdIB O9Ig== 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 b10-v6si17113265pgi.416.2018.09.10.03.20.15; Mon, 10 Sep 2018 03:20:30 -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 S1728354AbeIJPLz (ORCPT + 99 others); Mon, 10 Sep 2018 11:11:55 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44325 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbeIJPLy (ORCPT ); Mon, 10 Sep 2018 11:11:54 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w8AAIDlO1808607 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Sep 2018 03:18:13 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w8AAICio1808604; Mon, 10 Sep 2018 03:18:12 -0700 Date: Mon, 10 Sep 2018 03:18:12 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Chris Redpath Message-ID: Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, morten.rasmussen@arm.com, peterz@infradead.org, mingo@kernel.org, chris.redpath@arm.com, tglx@linutronix.de, hpa@zytor.com Reply-To: peterz@infradead.org, chris.redpath@arm.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, morten.rasmussen@arm.com In-Reply-To: <1530699470-29808-11-git-send-email-morten.rasmussen@arm.com> References: <1530699470-29808-11-git-send-email-morten.rasmussen@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Don't move tasks to lower capacity CPUs unless necessary Git-Commit-ID: 4ad3831a9d4af5e36da5d44a3b9c6522d0353cee X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4ad3831a9d4af5e36da5d44a3b9c6522d0353cee Gitweb: https://git.kernel.org/tip/4ad3831a9d4af5e36da5d44a3b9c6522d0353cee Author: Chris Redpath AuthorDate: Wed, 4 Jul 2018 11:17:48 +0100 Committer: Ingo Molnar CommitDate: Mon, 10 Sep 2018 11:05:53 +0200 sched/fair: Don't move tasks to lower capacity CPUs unless necessary 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. Signed-off-by: Chris Redpath Signed-off-by: Morten Rasmussen Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: dietmar.eggemann@arm.com Cc: gaku.inami.xh@renesas.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Link: http://lkml.kernel.org/r/1530699470-29808-11-git-send-email-morten.rasmussen@arm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8b228c5b3eb4..06ff75f4ac7b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8423,6 +8423,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); /*