Received: by 10.223.164.202 with SMTP id h10csp4279150wrb; Wed, 29 Nov 2017 04:01:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMaB2bnS41It6vVPCpHLLapDP4Va04M4dYaaXs8hqPCYHi/7LGVVVbB98JPnov/5Cm+/fqav X-Received: by 10.84.254.2 with SMTP id b2mr2584982plm.407.1511956867699; Wed, 29 Nov 2017 04:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511956867; cv=none; d=google.com; s=arc-20160816; b=TX1KFmWH19bv7UUPtERZJyJDqT+bk0y4qXOG8be09FQEqteQaz0rmHC8VEbQ/8ObSj +6BapLK7oJjAVxO3WztGPIM1Di9f+Fu89gtxujc0GBNxHyKMp2hH3M5Mrti+C/YOzNaw N2RL5r06k2tliOulQxjg0eeqNrtDnuj8O9t+BYCDBPGNVRWeRJm5uirb+fbfBfb7GDRe FSTyJU+JBlKis2J32LnrqbobrmbFGvhXW9cTzGlnwn3AUHBT9bcroxwHwQ1RBFecNpf7 /S/1RPu3vq+MWN/OTTzCX73lW97I5qXJ2t+rMlYouHauWvPGLyOyMYzyKUBiscPb3lUk lj4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=AouIXqJZLttajOnUrrPcTJwkqZRggvk5qS7pA4S1HW4=; b=OJflgobpci78+Ksr8dgngMUdftu3BGyPbze57Xb04R9BQ8ZuyNBAXbJYcZCAFs/acL JnMnGQvEiUVeDduyaZPu/4BWf6NaKu+iHz6Fcrw/uCniDh0XAwlRjNyqcOnvQKrOVKx7 3GNiBUX+ES0VmlUXqggBElFk1u1eZpWolDXRbK5Lk8BAeU/4GYh2qJ/70yqByYaih710 taTIAD+KSO8kCeE4HXGXPxXN6I3/s4PGw8vpZLJeGk93pUoe1rXGMHfVR9HD3L0R+73u aT9DFm69prpK3K//lC2JvD4OnGOn9IX7emF0P+KTfX4Q5JkGIxE0u7spJ31TR2w/OQYF ZGIg== 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 s90si1225974pfk.415.2017.11.29.04.00.57; Wed, 29 Nov 2017 04:01:07 -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 S1754528AbdK2MAB (ORCPT + 70 others); Wed, 29 Nov 2017 07:00:01 -0500 Received: from foss.arm.com ([217.140.101.70]:37384 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805AbdK2MAA (ORCPT ); Wed, 29 Nov 2017 07:00:00 -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 6BDFD1529; Wed, 29 Nov 2017 04:00:00 -0800 (PST) Received: from e105550-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3948C3F246; Wed, 29 Nov 2017 03:59:59 -0800 (PST) Date: Wed, 29 Nov 2017 11:59:52 +0000 From: Morten Rasmussen To: Vincent Guittot Cc: Peter Zijlstra , "mingo@redhat.com" , Dietmar Eggemann , mgalbraith@suse.de, linux-kernel Subject: Re: [PATCH] sched/topology: Set SD_PREFER_SIBLING consistently on non-NUMA levels Message-ID: <20171129115952.GA28106@e105550-lin.cambridge.arm.com> References: <1511803767-24572-1-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Resent without the disclaimer at the bottom. Sorry!] On Wed, Nov 29, 2017 at 10:24:57AM +0100, Vincent Guittot wrote: > Hi Morten, > > On 27 November 2017 at 18:29, Morten Rasmussen wrote: > > 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). > > So the goal is to have the last non-NUMA level with the flag so we can > spread between "DIE" The flag is already set on "DIE", the goal is to be consistent and set the flag consistently. As it is, it is set on SMT and DIE, but not MC: SMT: SD_PREFER_SIBLING MC: !SD_PREFER_SIBLING DIE: SD_PREFER_SIBLING So the goal is to spread consistently at all non-NUMA levels regardless of which levels are present as currently it is not that obvious when spreading happens on MC level as this list illustrates. > > > > > 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). > > This is to ensure that the last non NUMA level has the flag when the > DIE one disappears but the goal is the same as 2. My point was just summarize the conditions for enabling spreading. It doesn't guarantee that the last non-NUMA level is spreading. For example, x86 numa-in-package topology doesn't have DIE at all, so there is nothing to inherit. Going the argument used to introduce the flag on DIE level, it should be set on MC for those systems. The whole thing really boils down to: Why do we want to not always spread at all levels inside a single node? It seems that we almost always do that already. So why not make it truly always? > > 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. > > So you want to extend it to all non NUMA level. And especially you > want to spread tasks in each MC groups when we have DIE and MC levels. > Have you got benchmark results to show improvement or is it just to > align topology configuration? It is purely to have consistent scheduling behaviour and make it clearer how system topology affect scheduling. SD_PREFER_SIBLING is currently a behavioral flag, which means that each architecture cannot modify it, it is set by a set of rules based on the number of levels used by the architecture and the topology flags set. So should an architecture have platform with two or more non-SMT non-NUMA levels it is currently not possible to make the scheduler spread on both levels. > The fact that this flag improves bench for SMT and NUMA level doesn't > mean that it will improve for MC level as well. We have the > wake_wide/wake_affine stuffs that tries to do similar thing > dynamically and it regularly improves/regresses benchmark like > sysbench or hackbench True. wake_wide/wake_affine in the wake-up path has some of the same behaviour as SD_PREFER_SIBLING has for periodic/idle/nohz balancing. However, that is already consistently enabled for all levels apart for NUMA levels where the reclaim distance is too high. So currently we do allow some spreading, but not consistently. I can't say that this patch won't cause any regressions. I was hoping someone would say that it is definitely a bad idea with a good reason, or we try it for the benefit of consistent flag setting. I'm happy to drop the patch if there is good explanation for why the flag is set like it is, but I think we have to make it controllable by each architecture then. From 1585401445415513429@xxx Wed Nov 29 11:57:19 +0000 2017 X-GM-THRID: 1585241247547824571 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread