Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18531170ybl; Fri, 3 Jan 2020 04:15:52 -0800 (PST) X-Google-Smtp-Source: APXvYqzYUaTIyuHmUHFfwaPXK30NDw4QTTyUTb/A5q3gqd5cshsGJbf/g20sTMDcWRjSBIGlGEx9 X-Received: by 2002:a9d:367:: with SMTP id 94mr92958402otv.329.1578053752751; Fri, 03 Jan 2020 04:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578053752; cv=none; d=google.com; s=arc-20160816; b=BLVApMQpPW3eogTLVTKpufg06+3/IytOAJZlhJS1VR8KXhocmZc2II50G++8UQuEr+ QW0yBLoSNkYWwiJ0eTjOHw9TH8H7Lln/txRqaDTrjQawobCXY1vDVMBmCXJS/5zW6m/P h/B4njr8ugUiAiPjWDuTektVNW1reo+cCMjOHXcKzE0IH1tmJvxX0JxqJm1M50Liy/Dv zkKcLtvxblbbEKvSM8Xx8PW3hCVLePjH/F3yeG08Xgm/Jcr+IsioZeRX4L3/vp0eM2Jc DjKq4619AfzEF9Aj6/1SJv8m3vPRewUdxPLpjFLA1Z9Nha6++DDytiaL9E1VH7LJrmx+ 9r/Q== 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:references:cc:to:from:subject; bh=fgjoKbOfCTMCiQL8wHdU3xmx/msUdKJiUQcfs1BU+gc=; b=IUfuD3YYXY7EXMFmIm6x2tVu8pBBwaZVa99rB6A4V68U/oJ5cnqC2FNUu/ucgDJs7A Ck0lqn6GJzRVm0wDKwn8TsLFOcda+UUzUMHGS1TeKqSQU1I5c4Je/ciUxWKH0sG3qcd7 gx/CSPf2O01K3ghcXf0mzFm3yJ82fTNUuK50Uc8vxk2eRIGsNoZHu9bNdEIb+GD4Bt8V XEbLaG9l9NQnhgoCXewJ9X7gSsLid6rJ4OXbheQ5/h+KKYd5hXG1yHU8EaO6EODwW21C tGmPyV2v/8SPoiH4kA+1cEvdMyuYWt6KLsYEgO5bWQbRYQhE7JUgNdQ1jtRB0wMMZPIe S42A== 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 s18si10382827otr.172.2020.01.03.04.15.41; Fri, 03 Jan 2020 04:15:52 -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 S1727631AbgACMOi (ORCPT + 99 others); Fri, 3 Jan 2020 07:14:38 -0500 Received: from foss.arm.com ([217.140.110.172]:55160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727494AbgACMOi (ORCPT ); Fri, 3 Jan 2020 07:14:38 -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 F1B681FB; Fri, 3 Jan 2020 04:14:37 -0800 (PST) Received: from [10.1.194.46] (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 172583F237; Fri, 3 Jan 2020 04:14:36 -0800 (PST) Subject: Re: [PATCH] cpu-topology: warn if NUMA configurations conflicts with lower layer From: Valentin Schneider To: "Zengtao (B)" , Sudeep Holla Cc: Linuxarm , Greg Kroah-Hartman , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Morten Rasmussen References: <1577088979-8545-1-git-send-email-prime.zeng@hisilicon.com> <20191231164051.GA4864@bogus> <678F3D1BB717D949B966B68EAEB446ED340AE1D3@dggemm526-mbx.china.huawei.com> <20200102112955.GC4864@bogus> <678F3D1BB717D949B966B68EAEB446ED340AEB67@dggemm526-mbx.china.huawei.com> <678F3D1BB717D949B966B68EAEB446ED340AFCA0@dggemm526-mbx.china.huawei.com> <7b375d79-2d3c-422b-27a6-68972fbcbeaf@arm.com> Message-ID: <66943c82-2cfd-351b-7f36-5aefdb196a03@arm.com> Date: Fri, 3 Jan 2020 12:14:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <7b375d79-2d3c-422b-27a6-68972fbcbeaf@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/01/2020 10:57, Valentin Schneider wrote: > I'm juggling with other things atm, but let me have a think and see if we > couldn't detect that in the scheduler itself. > Something like this ought to catch your case; might need to compare group spans rather than pure group pointers. --- diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 6ec1e595b1d4..c4151e11afcd 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1120,6 +1120,13 @@ build_sched_groups(struct sched_domain *sd, int cpu) sg = get_group(i, sdd); + /* sg's are inited as self-looping. If 'last' is not self + * looping, we set it in a previous visit. No further visit + * should change the link order, if we do then the topology + * description is terminally broken. + */ + BUG_ON(last && last->next != last && last->next != sg); + cpumask_or(covered, covered, sched_group_span(sg)); if (!first)