From patchwork Mon Nov 27 17:29:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 119762 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp578529qgn; Mon, 27 Nov 2017 09:30:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMaR49Y2EIQW9VD5DA7r9wUJikwe59Zz4ZOTd8oQnd+cSTSnQE2oj7xlr0cwxQPghjZH+x0Y X-Received: by 10.84.241.67 with SMTP id u3mr31991843plm.275.1511803820477; Mon, 27 Nov 2017 09:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511803820; cv=none; d=google.com; s=arc-20160816; b=vBjwnrZieEs9vdRbCK3uzYuh+7Uxqn8atCI5zYgTaM2b4Jn1Rdgkn65W2LZxB8If0c YaJ53TQYAHeDWJuz4WcAdxbZcIVi5EBA0h7Hp2ZxUqXHd4breNYyTyIAy+qImM8KTcYL oMa0fVLhoXQRvlT4ARvFRFbdrfUkPk4CuDKblexW4NMyf6kMRiIDZriPki3Prl6Csnl3 XtLu0xEK9C74USENEi/qeFaS9YOtmsC9A1iDO9mhtKe2P2mxyo1v0OULuVisIqKHVVTx HE5NL8zdWeL0P0znvVh942pifd1gFkHXF37gZVCA3XQEJdOP5H+7OuPwY+kl0EzfvLCZ bS8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=p/VgTUfJ/vXbOcgL1wc9jGiCxn/rUmMI7k4JrOSPLxA=; b=qF30/FmeqFbfd5m/EkUoXqZt3DEd3s/yBgkKRb8Mw4DoN0lA7EeLdAZW8Ru13eJCaq Ubenbj4MF2NUWPLDVzwgzNHQGi2jHoBeoMSH17PA7AxKEurKXObCVzbf95rTlwA65eZ1 q6CF0j4s5DbI5viiYeHuh03BHBydQTeIrrXAW/u7Th8Vza/tHRxz+78p48Oz8ukpN91D QZIAnABTkBz25sZlFWR8uUN3Otv3WHA0iVDPleHOfW0X4aGi7NyMXAI3p9DBWVdDIbS1 fIAEYMtmmVGKX3KX3VVCcxh9ur372u2YOSZ6Z3oObPOANGJODrd54dGxHcH0HFuCj3Ey oxLg== 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 n7si14106729pgu.398.2017.11.27.09.30.20; Mon, 27 Nov 2017 09:30:20 -0800 (PST) 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 S1753939AbdK0RaS (ORCPT + 28 others); Mon, 27 Nov 2017 12:30:18 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41922 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808AbdK0RaR (ORCPT ); Mon, 27 Nov 2017 12:30:17 -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 33C721529; Mon, 27 Nov 2017 09:30:17 -0800 (PST) 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 D130B3F236; Mon, 27 Nov 2017 09:30:15 -0800 (PST) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: dietmar.eggemann@arm.com, vincent.guittot@linaro.org, mgalbraith@suse.de, linux-kernel@vger.kernel.org, Morten Rasmussen Subject: [PATCH] sched/topology: Set SD_PREFER_SIBLING consistently on non-NUMA levels Date: Mon, 27 Nov 2017 17:29:27 +0000 Message-Id: <1511803767-24572-1-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SD_PREFER_SIBLING adds an additional bias towards spreading tasks on the _parent_ sched_domain even if a sched_group isn't overloaded. It is currently set on: 1. SMT level to promote spreading to sibling cores rather than using sibling HW-threads (caff37ef96eac7fe96a). 2. Non-NUMA levels which don't have the SD_SHARE_PKG_RESOURCES flag set (= DIE level in the default topology) as it was found to improve benchmarks on certain NUMA systems (6956dc568f34107f1d02b). 3. Any non-NUMA level that inherits the flag due to elimination of its parent sched_domain level in the de-generate step of the sched_domain hierarchy set up (= MC level in the default topology). Preferring siblings seems to be a useful tweak for all non-NUMA levels, so we should enable it on all non-NUMA levels. As it is, it is possible to have it SMT and DIE, but not MC in between when using the default topology. Signed-off-by: Morten Rasmussen cc: Ingo Molnar cc: Peter Zijlstra --- kernel/sched/topology.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 6798276d29af..7f70806bfa0f 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1122,7 +1122,7 @@ sd_init(struct sched_domain_topology_level *tl, | 0*SD_SHARE_CPUCAPACITY | 0*SD_SHARE_PKG_RESOURCES | 0*SD_SERIALIZE - | 0*SD_PREFER_SIBLING + | 1*SD_PREFER_SIBLING | 0*SD_NUMA | sd_flags , @@ -1153,7 +1153,6 @@ sd_init(struct sched_domain_topology_level *tl, } if (sd->flags & SD_SHARE_CPUCAPACITY) { - sd->flags |= SD_PREFER_SIBLING; sd->imbalance_pct = 110; sd->smt_gain = 1178; /* ~15% */ @@ -1168,6 +1167,7 @@ sd_init(struct sched_domain_topology_level *tl, sd->busy_idx = 3; sd->idle_idx = 2; + sd->flags &= ~SD_PREFER_SIBLING; sd->flags |= SD_SERIALIZE; if (sched_domains_numa_distance[tl->numa_level] > RECLAIM_DISTANCE) { sd->flags &= ~(SD_BALANCE_EXEC | @@ -1177,7 +1177,6 @@ sd_init(struct sched_domain_topology_level *tl, #endif } else { - sd->flags |= SD_PREFER_SIBLING; sd->cache_nice_tries = 1; sd->busy_idx = 2; sd->idle_idx = 1;