Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4293973imu; Mon, 12 Nov 2018 08:43:01 -0800 (PST) X-Google-Smtp-Source: AJdET5f3a6ib/S4Y+Ipyod1SYar4B0y1vTEc1+n6gXgl8oeDq+rgjC5bcp1OOXOTwjYtA0/pThiG X-Received: by 2002:a63:c303:: with SMTP id c3mr1445828pgd.268.1542040981448; Mon, 12 Nov 2018 08:43:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542040981; cv=none; d=google.com; s=arc-20160816; b=zt9z4SCXWXbb1aw54WEKZ5yw9Hve7RcCgB5R/PjpqgI5JWJTIWtLP/ZOGGg7Y2esAK 4grzyr0bkhNNNPHyvg07rr6LzNumKCfwgZAdJE7IBdoFw9pd5IKn7zD0dTOdXEyoCEBT x3v0KURaDts9hQ3b/L6zVvQuSRs7FRgPJ2XFbb0D48tfAJwIDVABlvQsONXcx6cuR8pm valYu6GZFjPELKRqALiLGQ3yrQVDSncaL64unEDopwhmAv1oenoQIqt+QVX5+WOE0e+7 M/XH8L3ogJedzwzCOTl7bgpJT7rRfjngK2rdxlq9QwsOUZisqRA6VbrdqWT67KuCRV+s hOjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5MKyNbBxABUlkfhPw3wwP125eUiY/RwON9LAZlYlqnc=; b=VJQUDN3xYRLw+Xp06ECLngHze/9DnXYuiQmgXmcsMOXQf3vy0OZy/A4iMDjS6FlSGx jQDiR6mwnheeopy5TmR9YEZevf9VARmfMdaxveHenn/ZGMAtADgMQAHQ4sQUv1RIdmSE cmNa6Twr7YVIhFwthalPPQrWptlkzkYvEqS/KNA/Rj4Xp2K/W85qYSBQyM+u+FvockWI NMp+a+slUp8S7Hh6dSWA5gjcVq816EoEUDsCbaQHLEdC9ycLSu4UF975aY9+gbrIPFP4 r/x723iqEojL9buLmdLgBXZjA2fcbFG5akIFuUhxMFWFZD5v0vzgWPJdQJdAm+wLE8FN oDLw== 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 l11si16240435pgb.545.2018.11.12.08.42.46; Mon, 12 Nov 2018 08:43:01 -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 S1730089AbeKMCgR (ORCPT + 99 others); Mon, 12 Nov 2018 21:36:17 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39484 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbeKMCgP (ORCPT ); Mon, 12 Nov 2018 21:36:15 -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 19F4E15AB; Mon, 12 Nov 2018 08:42:15 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD10A3F5CF; Mon, 12 Nov 2018 08:42:12 -0800 (PST) Subject: Re: [PATCH v3 03/10] sched/topology: Provide cfs_overload_cpus bitmap To: Steve Sistare , mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, quentin.perret@arm.com, linux-kernel@vger.kernel.org References: <1541767840-93588-1-git-send-email-steven.sistare@oracle.com> <1541767840-93588-4-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: Date: Mon, 12 Nov 2018 16:42:11 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1541767840-93588-4-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On 09/11/2018 12:50, Steve Sistare wrote: > From: Steve Sistare > > Define and initialize a sparse bitmap of overloaded CPUs, per > last-level-cache scheduling domain, for use by the CFS scheduling class. > Save a pointer to cfs_overload_cpus in the rq for efficient access. > > Signed-off-by: Steve Sistare > --- > include/linux/sched/topology.h | 1 + > kernel/sched/sched.h | 2 ++ > kernel/sched/topology.c | 21 +++++++++++++++++++-- > 3 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h > index 6b99761..b173a77 100644 > --- a/include/linux/sched/topology.h > +++ b/include/linux/sched/topology.h > @@ -72,6 +72,7 @@ struct sched_domain_shared { > atomic_t ref; > atomic_t nr_busy_cpus; > int has_idle_cores; > + struct sparsemask *cfs_overload_cpus; Thinking about misfit stealing, we can't use the sd_llc_shared's because on big.LITTLE misfit migrations happen across LLC domains. I was thinking of adding a misfit sparsemask to the root_domain, but then I thought we could do the same thing for cfs_overload_cpus. By doing so we'd have a single source of information for overloaded CPUs, and we could filter that down during idle balance - you mentioned earlier wanting to try stealing at each SD level. This would also let you get rid of [PATCH 02]. The main part of try_steal() could then be written down as something like this: ----->8----- for_each_domain(this_cpu, sd) { span = sched_domain_span(sd) for_each_sparse_wrap(src_cpu, overload_cpus) { if (cpumask_test_cpu(src_cpu, span) && steal_from(dts_rq, dst_rf, &locked, src_cpu)) { stolen = 1; goto out; } } } ------8<----- We could limit the stealing to stop at the highest SD_SHARE_PKG_RESOURCES domain for now so there would be no behavioural change - but we'd factorize the #ifdef SCHED_SMT bit. Furthermore, the door would be open to further stealing. What do you think? [...]