From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 231F4C433DB for ; Fri, 19 Mar 2021 09:39:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B007264DEF for ; Fri, 19 Mar 2021 09:39:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B007264DEF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=Huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ANl76feE8SzbNuF27vc6DD5IDYYST4zaoMbe6JWrNv8=; b=gI7t8Fgg+lS16ID9Pb79CkpV3 SuFLahT5kKFzenEb4g78WINEczUQNdyz85X6EwmsRtaUiy6bvGPz6iZC08r0tqs9TdWrllMJVkh15 Lg445qY0ajBb5a8biHgjCJz/f4IiLbtGgNHLR38c7tKs7voe99WcNKivYimWrFGXGoM7yPtLtVs4N H8o32gK0HU9a03mejYeGcT9ejA/GXs2NdBcx1JbmZF271SmGuu1uJuejW2sRO7I11ePwY8mSgqQDq aFxxG+9xZP5PKRTZCVcGxUkg6/oDuhz+PAFwxb19ffI3HZWrXUeCHy0JswCwZBZEf3Q1LRfCkYUDp Q/TjdGk6A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNBZl-006xWg-TW; Fri, 19 Mar 2021 09:37:50 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNBZg-006xVW-PP for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 09:37:48 +0000 Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4F1zG14Flrz681ZH; Fri, 19 Mar 2021 17:32:57 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 19 Mar 2021 10:37:34 +0100 Received: from localhost (10.47.25.23) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 19 Mar 2021 09:37:33 +0000 Date: Fri, 19 Mar 2021 09:36:16 +0000 From: Jonathan Cameron To: "Song Bao Hua (Barry Song)" CC: Greg KH , "tim.c.chen@linux.intel.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "rjw@rjwysocki.net" , "vincent.guittot@linaro.org" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "lenb@kernel.org" , "peterz@infradead.org" , "dietmar.eggemann@arm.com" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , "msys.mizuma@gmail.com" , "valentin.schneider@arm.com" , "juri.lelli@redhat.com" , "mark.rutland@arm.com" , "sudeep.holla@arm.com" , "aubrey.li@linux.intel.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "x86@kernel.org" , "xuwei (O)" , "Zengtao (B)" , "guodong.xu@linaro.org" , yangyicong , "Liguozhu (Kenneth)" , "linuxarm@openeuler.org" , "hpa@zytor.com" Subject: Re: [RFC PATCH v5 1/4] topology: Represent clusters of CPUs within a die Message-ID: <20210319093616.00001879@Huawei.com> In-Reply-To: References: <20210319041618.14316-1-song.bao.hua@hisilicon.com> <20210319041618.14316-2-song.bao.hua@hisilicon.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.47.25.23] X-ClientProxiedBy: lhreml730-chm.china.huawei.com (10.201.108.81) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_093745_026714_402C65B4 X-CRM114-Status: GOOD ( 27.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 19 Mar 2021 06:57:08 +0000 "Song Bao Hua (Barry Song)" wrote: > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Friday, March 19, 2021 7:35 PM > > To: Song Bao Hua (Barry Song) > > Cc: tim.c.chen@linux.intel.com; catalin.marinas@arm.com; will@kernel.org; > > rjw@rjwysocki.net; vincent.guittot@linaro.org; bp@alien8.de; > > tglx@linutronix.de; mingo@redhat.com; lenb@kernel.org; peterz@infradead.org; > > dietmar.eggemann@arm.com; rostedt@goodmis.org; bsegall@google.com; > > mgorman@suse.de; msys.mizuma@gmail.com; valentin.schneider@arm.com; Jonathan > > Cameron ; juri.lelli@redhat.com; > > mark.rutland@arm.com; sudeep.holla@arm.com; aubrey.li@linux.intel.com; > > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > > linux-acpi@vger.kernel.org; x86@kernel.org; xuwei (O) ; > > Zengtao (B) ; guodong.xu@linaro.org; yangyicong > > ; Liguozhu (Kenneth) ; > > linuxarm@openeuler.org; hpa@zytor.com > > Subject: Re: [RFC PATCH v5 1/4] topology: Represent clusters of CPUs within > > a die > > > > On Fri, Mar 19, 2021 at 05:16:15PM +1300, Barry Song wrote: > > > diff --git a/Documentation/admin-guide/cputopology.rst > > b/Documentation/admin-guide/cputopology.rst > > > index b90dafc..f9d3745 100644 > > > --- a/Documentation/admin-guide/cputopology.rst > > > +++ b/Documentation/admin-guide/cputopology.rst > > > @@ -24,6 +24,12 @@ core_id: > > > identifier (rather than the kernel's). The actual value is > > > architecture and platform dependent. > > > > > > +cluster_id: > > > + > > > + the Cluster ID of cpuX. Typically it is the hardware platform's > > > + identifier (rather than the kernel's). The actual value is > > > + architecture and platform dependent. > > > + > > > book_id: > > > > > > the book ID of cpuX. Typically it is the hardware platform's > > > @@ -56,6 +62,14 @@ package_cpus_list: > > > human-readable list of CPUs sharing the same physical_package_id. > > > (deprecated name: "core_siblings_list") > > > > > > +cluster_cpus: > > > + > > > + internal kernel map of CPUs within the same cluster. > > > + > > > +cluster_cpus_list: > > > + > > > + human-readable list of CPUs within the same cluster. > > > + > > > die_cpus: > > > > > > internal kernel map of CPUs within the same die. > > > > Why are these sysfs files in this file, and not in a Documentation/ABI/ > > file which can be correctly parsed and shown to userspace? > > Well. Those ABIs have been there for much a long time. It is like: > > [root@ceph1 topology]# ls > core_id core_siblings core_siblings_list physical_package_id thread_siblings thread_siblings_list > [root@ceph1 topology]# pwd > /sys/devices/system/cpu/cpu100/topology > [root@ceph1 topology]# cat core_siblings_list > 64-127 > [root@ceph1 topology]# > > > > > Any chance you can fix that up here as well? > > Yes. we will send a separate patch to address this, which won't > be in this patchset. This patchset will base on that one. > > > > > Also note that "list" is not something that goes in sysfs, sysfs is "one > > value per file", and a list is not "one value". How do you prevent > > overflowing the buffer of the sysfs file if you have a "list"? > > > > At a glance, the list is using "-" rather than a real list > [root@ceph1 topology]# cat core_siblings_list > 64-127 > > Anyway, I will take a look if it has any chance to overflow. It could in theory be alternate CPUs as comma separated list. So it's would get interesting around 500-1000 cpus (guessing). Hopefully no one has that crazy a cpu numbering scheme but it's possible (note that cluster is fine for this, but I guess it might eventually happen for core-siblings list (cpus within a package). Shouldn't crash or anything like that but might terminate early. On sysfs file conversion, that got mentioned earlier but I forgot to remind Barry about it when he took this patch into his series. Sorry about that! Jonathan > > > thanks, > > > > greg k-h > > Thanks > Barry > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel