Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp15487693ybl; Tue, 31 Dec 2019 08:44:04 -0800 (PST) X-Google-Smtp-Source: APXvYqz7r1GqkWKAO3ATcbnRrc/Pve7rvYGqL4h1mB9uGToaowI2aCu1fSgn0NgOQowZXAO1E7A0 X-Received: by 2002:a05:6402:311b:: with SMTP id dc27mr77686312edb.36.1577810644645; Tue, 31 Dec 2019 08:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577810644; cv=none; d=google.com; s=arc-20160816; b=dL+a3vd7N+JzDR9YF+HD9Fq3cgirUIUb2WiDx62U5AEegDAKqM5QC7tl6+sgYmfUk9 sT+EMHdjbI/u5ObYE49VMpFIh1Fdks58WOJA88OE86JRNzKpeUzljEPt7B2w6nAQSOak JwSZbzEh935BSYSxV4MaRgB7fHmO0sl3iLxTiQK0o0QGiarSkH2EbAhbTeGtMrUhSE3U tLeEM3IcYjvOKSx4mHmphukopPwyIs89kHPkiBTMwX1ISDV+pquuMa0mRWfC1RR3c64y EZoj4iUZYztBJYTtH/0t6P99RjTxpvEkM30s/Y5YDyXsRmPrXVwPHbXnZnqyXzEAOCib iU4w== 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; bh=dHnAmHeu5xS3ckW8E+M1R29jB17s+J3upYHgnstoyx8=; b=jwIVQ7AEvtQMXQYjyYXvJ8b1gHMBHdoKbjtW3zbSszoOUfccBqR+6EIvWdXW/ZJAtQ zuH8X3I9OJ0Do6y2322pRGZhAa3AuochjR9WoHIevVvAQsY9sm0PlJcXGwh7UjjOWPl5 ZKpbhFWLNgxlIzmGWiLOLxmOSYqsgaGElIxUF6OfYa/l/IASEo2ZBkyUtx6kRpTrknAk nKoTuPHo8dZizTe6FZshP0BNV3jKCnVer+qu3J9ty2MTzaDqPJCVMksxPcE3ZhXszVCX jDmq3ti17Jyt5VZdXO1/SEHZuVUhY0YnlrGnnFSDYKhgGsdG/rc47haFEGdEbvuPvJZM AvhQ== 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 o20si31687371ejx.211.2019.12.31.08.43.40; Tue, 31 Dec 2019 08:44:04 -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 S1727109AbfLaQlE (ORCPT + 99 others); Tue, 31 Dec 2019 11:41:04 -0500 Received: from foss.arm.com ([217.140.110.172]:35818 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfLaQlE (ORCPT ); Tue, 31 Dec 2019 11:41:04 -0500 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 5AAF2328; Tue, 31 Dec 2019 08:41:03 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C23C3F68F; Tue, 31 Dec 2019 08:41:02 -0800 (PST) Date: Tue, 31 Dec 2019 16:40:51 +0000 From: Sudeep Holla To: z00214469 Cc: linuxarm@huawei.com, Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Sudeep Holla , Morten Rasmussen Subject: Re: [PATCH] cpu-topology: warn if NUMA configurations conflicts with lower layer Message-ID: <20191231164051.GA4864@bogus> References: <1577088979-8545-1-git-send-email-prime.zeng@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1577088979-8545-1-git-send-email-prime.zeng@hisilicon.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 23, 2019 at 04:16:19PM +0800, z00214469 wrote: > As we know, from sched domain's perspective, the DIE layer should be > larger than or at least equal to the MC layer, and in some cases, MC > is defined by the arch specified hardware, MPIDR for example, but NUMA > can be defined by users, Who are the users you are referring above ? > with the following system configrations: Do you mean ACPI tables or DT or some firmware tables ? > ************************************* > NUMA: 0-2, 3-7 Is the above simply wrong with respect to hardware and it actually match core_siblings ? > core_siblings: 0-3, 4-7 > ************************************* > Per the current code, for core 3, its MC cpu map fallbacks to 3~7(its > core_sibings is 0~3 while its numa node map is 3~7). > > For the sched MC, when we are build sched groups: > step1. core3 's sched groups chain is built like this: 3->4->5->6->7->3 > step2. core4's sched groups chain is built like this: 4->5->6->7->4 > so after step2, core3's sched groups for MC level is overlapped, more > importantly, it will fall to dead loop if while(sg != sg->groups) > > Obviously, the NUMA node with cpu 3-7 conflict with the MC level cpu > map, but unfortunately, there is no way even detect such cases. > Again, is cpu 3-7 actually in a NUMA node or is it 4-7 ? > In this patch, prompt a warning message to help with the above cases. > > Signed-off-by: Zeng Tao > --- > drivers/base/arch_topology.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 1eb81f11..5fe44b3 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -439,10 +439,18 @@ const struct cpumask *cpu_coregroup_mask(int cpu) > if (cpumask_subset(&cpu_topology[cpu].core_sibling, core_mask)) { > /* not numa in package, lets use the package siblings */ > core_mask = &cpu_topology[cpu].core_sibling; > - } > + } else > + pr_warn_once("Warning: suspicous broken topology: cpu:[%d]'s core_sibling:[%*pbl] not a subset of numa node:[%*pbl]\n", > + cpu, cpumask_pr_args(&cpu_topology[cpu].core_sibling), > + cpumask_pr_args(core_mask)); > + Won't this print warning on all systems that don't have numa within a package ? What are you trying to achieve here ? > if (cpu_topology[cpu].llc_id != -1) { > if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask)) > core_mask = &cpu_topology[cpu].llc_sibling; > + else > + pr_warn_once("Warning: suspicous broken topology: cpu:[%d]'s llc_sibling:[%*pbl] not a subset of numa node:[%*pbl]\n", > + cpu, cpumask_pr_args(&cpu_topology[cpu].llc_sibling), > + cpumask_pr_args(core_mask)); > } > This will trigger warning on all systems that lack cacheinfo topology. I don't understand the intent of this patch at all. Can you explain all the steps you follow and the issue you face ? -- Regards, Sudeep