Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3909165imj; Tue, 19 Feb 2019 11:36:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IYgnXHloQuH8/s1M+0EZXcCRnsTo2V2Lp2nyvT7ZYeyhZfRJX3DPe+CJQ98trVAStgTv3Si X-Received: by 2002:a62:3a01:: with SMTP id h1mr30217757pfa.169.1550604960201; Tue, 19 Feb 2019 11:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550604960; cv=none; d=google.com; s=arc-20160816; b=R6hXysjvoEvP5lNhTWJW5AOJXucgFMIcMJzkxaGvhnDRMQ3nqsWFcasrStQph5VYWO GHmL7y2gwtepUyV012dM+p7e8XcJAEpN8ngKB8fNzbcDQeZdSA+EzkuGngP2iHS13viv kcscuJaGI6YGN9CxMVe/MuBWO7De6ByAlaniGdUfnQoHQAsMT01mUg4KMs8MzATpWmEX 5KgSvCb1OmxEJXPr+VHzTUklgpeDRZhmePDnJ+WF/vrJFMTr6PoOOSc0dbBVXOOw03KA zaj2n0pVhdyqBuV09Km9JJI6ckPWkwfQS99VseUe0WiQRsZK9Lp5IxBO0I5/EENl82Zu iSFA== 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=F4kpHfK0rKNE8Z/lkJ61lWU1FP91cwBDJiC6jUeZUYw=; b=GkXcAkU2xk2lD0Dzf2x0uihtNkBWfYHV8c93htKT+jW5Hr7LxbR3Y51m2BAW7w+fwG vkZk+O04wKhRewyK9N2tlzBds6iuit7Cgx6D7WEsfK3OHqbVAGa7ZjorV4PYJlrM5Nab JCK2Da7BuXC0AgoNrEJ6ZIUG1OfGd5/em8EZQW9cBO4RBTah/m79W1aZGBSkJKK+Z/gq np5+pDkavrOIpShdnpczJ9b2xc4lCjbr/z/si/l5UaTlMIiU+kACR94zD+diqmz4/jvA Y97k+GTrNCiRBSxF15aHsHpNMesBLEYplF44HJfn5SLJ4v0AAhdbriEwgqI/IegOubjK 7hIg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si6379753pgm.335.2019.02.19.11.35.44; Tue, 19 Feb 2019 11:36:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727426AbfBSTeC (ORCPT + 99 others); Tue, 19 Feb 2019 14:34:02 -0500 Received: from mga04.intel.com ([192.55.52.120]:7330 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfBSTeC (ORCPT ); Tue, 19 Feb 2019 14:34:02 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 11:34:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,388,1544515200"; d="scan'208";a="125651311" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 19 Feb 2019 11:34:01 -0800 Received: from [10.254.80.103] (acjohnso-mobl1.amr.corp.intel.com [10.254.80.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id E32E858019B; Tue, 19 Feb 2019 11:34:00 -0800 (PST) Subject: Re: [PATCH 05/11] x86 topology: export die_siblings To: "Brown, Len" , Len Brown , "x86@kernel.org" Cc: "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> <0d54a56186fb9be7a8f622a4625a41dc600dd7a4.1550545163.git.len.brown@intel.com> <59e07a24-dc44-c21b-91d4-ea04e8d0653e@linux.intel.com> <1A7043D5F58CCB44A599DFD55ED4C9485C5B75B9@FMSMSX126.amr.corp.intel.com> From: "Liang, Kan" Message-ID: <70ea25e2-6538-77ec-8686-40567e8d362b@linux.intel.com> Date: Tue, 19 Feb 2019 14:33:59 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1A7043D5F58CCB44A599DFD55ED4C9485C5B75B9@FMSMSX126.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 2/19/2019 1:43 PM, Brown, Len wrote: > Thanks for the comments, Kan, > >>> diff --git a/Documentation/cputopology.txt >>> b/Documentation/cputopology.txt index 287213b4517b..7dd2ae3df233 >>> 100644 >>> --- a/Documentation/cputopology.txt >>> +++ b/Documentation/cputopology.txt >>> @@ -56,6 +56,16 @@ core_siblings_list: >>> human-readable list of cpuX's hardware threads within the same >>> die_id. >>> >>> +die_siblings: >>> + >>> + internal kernel map of cpuX's hardware threads within the same >>> + physical_package_id. >>> + >>> +die_siblings_list: >>> + >>> + human-readable list of cpuX's hardware threads within the same >>> + physical_package_id. >>> + >>> book_siblings: >>> >>> internal kernel map of cpuX's hardware threads within the same diff > >> Could you please update the document regarding to topology_die_cpumask and topology_core_cpumask in Documentation/x86/topology.txt > > I agree that the top part of this file, as updated above, should document the external sysfs interface... > > I'm less excited about the center of the file trying to document the internal implementation -- as the source code > is actually more clear than the document, but here is an update, consistent with the existing file. > Let me know if it does not fully address your comment. > Besides the generic document, I think we should update x86 document as well, which is in Documentation/x86/topology.txt. The definition of topology_core_cpumask has to be changed to per die, right? diff --git a/Documentation/x86/topology.txt b/Documentation/x86/topology.txt index 8107b6c..8698a41 100644 --- a/Documentation/x86/topology.txt +++ b/Documentation/x86/topology.txt @@ -105,11 +105,16 @@ The topology of a system is described in the units of: Thread-related topology information in the kernel: - - topology_core_cpumask(): + - topology_die_cpumask(): The cpumask contains all online threads in the package to which a thread belongs. + - topology_core_cpumask(): + + The cpumask contains all online threads in the die to which a thread + belongs. + The number of online threads is also printed in /proc/cpuinfo "siblings." - topology_sibling_cpumask(): Thanks, Kan > Thanks, > -Len > --- > > diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt > index 7dd2ae3..f39c759 100644 > --- a/Documentation/cputopology.txt > +++ b/Documentation/cputopology.txt > @@ -102,6 +102,7 @@ these macros in include/asm-XXX/topology.h:: > #define topology_drawer_id(cpu) > #define topology_sibling_cpumask(cpu) > #define topology_core_cpumask(cpu) > + #define topology_die_cpumask(cpu) > #define topology_book_cpumask(cpu) > #define topology_drawer_cpumask(cpu) > > @@ -114,10 +115,11 @@ To be consistent on all architectures, include/linux/topology.h > provides default definitions for any of the above macros that are > not defined by include/asm-XXX/topology.h: > > -1) physical_package_id: -1 > -2) core_id: 0 > -3) sibling_cpumask: just the given CPU > -4) core_cpumask: just the given CPU > +1) topology_physical_package_id: -1 > +2) topology_core_id: 0 > +3) topology_sibling_cpumask: just the given CPU > +4) topology_core_cpumask: just the given CPU > +5) topology_die_cpumask: just the given CPU > > For architectures that don't support books (CONFIG_SCHED_BOOK) there are no > default definitions for topology_book_id() and topology_book_cpumask(). > >