From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 028F5C43387 for ; Thu, 17 Jan 2019 15:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEF8120883 for ; Thu, 17 Jan 2019 15:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728120AbfAQPhs (ORCPT ); Thu, 17 Jan 2019 10:37:48 -0500 Received: from foss.arm.com ([217.140.101.70]:42036 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbfAQPho (ORCPT ); Thu, 17 Jan 2019 10:37:44 -0500 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 0E2DD1650; Thu, 17 Jan 2019 07:37:44 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AB5EE3F819; Thu, 17 Jan 2019 07:37:42 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, morten.rasmussen@arm.com, Dietmar.Eggemann@arm.com Subject: [PATCH 5/5] sched/fair: Skip LLC nohz logic for asymmetric systems Date: Thu, 17 Jan 2019 15:34:11 +0000 Message-Id: <20190117153411.2390-6-valentin.schneider@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190117153411.2390-1-valentin.schneider@arm.com> References: <20190117153411.2390-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The LLC nohz condition will become true as soon as >=2 CPUs in a single LLC domain are busy. On big.LITTLE systems, this translates to two or more CPUs of a "cluster" (big or LITTLE) being busy. Issuing a nohz kick in these conditions isn't desired for asymmetric systems, as if the busy CPUs can provide enough compute capacity to the running tasks, then we can leave the nohz CPUs in peace. Skip the LLC nohz condition for asymmetric systems, and rely on nr_running & capacity checks to trigger nohz kicks when the system actually needs them. Suggested-by: Morten Rasmussen Signed-off-by: Valentin Schneider --- kernel/sched/fair.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 291dfdb0183f..ff27bf56e8d4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9545,6 +9545,17 @@ static void nohz_balancer_kick(struct rq *rq) } rcu_read_lock(); + + if (static_branch_unlikely(&sched_asym_cpucapacity)) + /* + * For asymmetric systems, we do not want to nicely balance + * cache use, instead we want to embrace asymmetry and only + * ensure tasks have enough CPU capacity. + * + * Skip the LLC logic because it's not relevant in that case. + */ + goto check_capacity; + sds = rcu_dereference(per_cpu(sd_llc_shared, cpu)); if (sds) { /* @@ -9564,6 +9575,7 @@ static void nohz_balancer_kick(struct rq *rq) } +check_capacity: sd = rcu_dereference(rq->sd); if (sd) { if ((rq->cfs.h_nr_running >= 1) && -- 2.20.1