Received: by 10.223.164.202 with SMTP id h10csp1941684wrb; Mon, 27 Nov 2017 09:31:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMaehq0OG3BQAMq4+gWATRhHHg/tiNiDN6sK2mS3PEJTeM0al8ZAtyHExkxVhK3nAS6pALxo X-Received: by 10.159.247.22 with SMTP id d22mr22507937pls.284.1511803863110; Mon, 27 Nov 2017 09:31:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511803863; cv=none; d=google.com; s=arc-20160816; b=upB1K011S5cUL9UCUoyK32Ksgj1UOVjfOH+dIjoKmEADNOBO8pNl8B5sng0RDLNpCK MK8jR03DRM6ursVxIfYCylNEK3YzTa+2yfX7Je1CJuJBmQvQEZqivNEVb6Jg3Bpx4HXS tK4mc5x7BztRvu7y6H4bEW0ocD04pEPJYK8D/gR1CYJzn+K1pldsi8UABYw0CTp5n0Qb cYs3Aizul6AMXRdvbKHVs6h7RENj3WSN+npn7Va1A8UE3CdVaFqVtUiUVwIHyxjVtkWK FMfBicrdl2LZBrdetKDYKraLqh3O1Va74ZePT+eDFhaxXdzChKbEoJHCWSfXahgqK0eB mHgA== 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 1si23632843plz.646.2017.11.27.09.30.51; Mon, 27 Nov 2017 09:31:03 -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 S1753932AbdK0RaS (ORCPT + 78 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(-) 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; -- 2.7.4 From 1585410106562027704@xxx Wed Nov 29 14:14:59 +0000 2017 X-GM-THRID: 1585410106562027704 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread