Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp855298ybb; Wed, 25 Mar 2020 10:54:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtB4AsfRN7qwYyP+rtKT+HVuAXM0gLhAPH8jqI17D+q//8dCvZZYoeBS2HJtD4Jw3M+KFbe X-Received: by 2002:a05:6830:22d9:: with SMTP id q25mr3288843otc.164.1585158883418; Wed, 25 Mar 2020 10:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585158883; cv=none; d=google.com; s=arc-20160816; b=kjovdYxez4GrjXOczOeW924Vt1NkN//otUq7/xbIOSV9y2rwuu94XujidrBlfRcoz3 NhSO5B8o3p+H7W5oX4LJ9OqfUNdwVH4kLtUB1fG0oUIypjH1V8PCzAhzYz8mbc6VNohq 6ZnNMn7EF2lVkXQubCMbUxNCaMU24Mmh/GNSAsLYqprrQmJ1GXRNhRZ+XJtirkgHM1Tb t3nGgd7KQQL1lejQAyaOshG4N7CgkC0ptToFL9AWmajh9BzdtSPdvUSZV8CX9mWHf7of KV28WaSfoq5RDOhISiAnYPkFDOsVMX71mA+bM/DMJsrNi6rvMws4rVLKf2R2Pv58SLFo nYlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:date:in-reply-to:message-id :subject:cc:to:from:user-agent:references; bh=nmUIVlnTO9qWVD9Q62A6hz6yDlwoJbMtBvSvQ/S4Jc0=; b=if4xu9Mz9TIV8VSJoPOgdSVvJxdlB5ljDH+/scGGIShi3HJp2oVWlQhd4YCtSXpN1w HLhIVlv90qJMpvCb7NS4Wo330pFFcrWG1M/rqAPi7pGV8IfF5M2gAny3evkY3eQiKS7m i8KHdzrrwiJ9GSNJE/XnsKaS9i5dcnEzQjDCLrb3swaUKcDKuaLWCsxmQ5regBUVZvKU fd5u0JbqOrO2cljPi3TSh2QzUYodhqLeOMTKrADUuTXDLvYDAz+TOsPNFPvt2BPoIjn+ uWV8xB75GKKfBj3mwMMAoAn/LiWvqAKK4QTV4jfoA9hM2D3oMg2PS9iprwvRbJ7YhRXp ZKyA== 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 l15si3940560otn.258.2020.03.25.10.54.30; Wed, 25 Mar 2020 10:54:43 -0700 (PDT) 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 S1727706AbgCYRyG (ORCPT + 99 others); Wed, 25 Mar 2020 13:54:06 -0400 Received: from foss.arm.com ([217.140.110.172]:51654 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgCYRyG (ORCPT ); Wed, 25 Mar 2020 13:54:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AF43930E; Wed, 25 Mar 2020 10:54:05 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AEAF03F52E; Wed, 25 Mar 2020 10:54:04 -0700 (PDT) References: <20200324125533.17447-1-valentin.schneider@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, mgorman@techsingularity.net Subject: Re: [PATCH] sched/topology: Fix overlapping sched_group build Message-ID: In-reply-to: <20200324125533.17447-1-valentin.schneider@arm.com> Date: Wed, 25 Mar 2020 17:53:56 +0000 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24 2020, Valentin Schneider wrote: > kernel/sched/topology.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 8344757bba6e..7033b27e5162 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -866,7 +866,7 @@ build_balance_mask(struct sched_domain *sd, struct sched_group *sg, struct cpuma > continue; > > /* If we would not end up here, we can't continue from here */ > - if (!cpumask_equal(sg_span, sched_domain_span(sibling->child))) > + if (!cpumask_subset(sg_span, sched_domain_span(sibling->child))) So this is one source of issues; what I've done here is a bit stupid since we include CPUs that *cannot* end up there. What I should've done is something like: cpumask_and(tmp, sched_domain_span(sibling->child), sched_domain_span(sd)); if (!cpumask_equal(sg_span, tmp)) ... But even with that I just unfold even more horrors: this breaks the overlapping sched_group_capacity (see 1676330ecfa8 ("sched/topology: Fix overlapping sched_group_capacity")). For instance, here I would have CPU0-domain2-group4: span=4-5 CPU4-domain2-group4: span=4-7 mask=4-5 Both groups are at the same topology level and have the same first CPU, so they point to the same sched_group_capacity structure - but they don't have the same span. They would without my "fix", but then the group spans are back to being wrong. I'm starting to think this is doomed, at least in the current state of things :/