Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5540294yba; Mon, 13 May 2019 12:40:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ9cDWUDURzV4gayC9OPxrAdLZ1CnAQVM0U/bj+sue6XsvR4X7MohYlZmokHWY7Hn7JTj0 X-Received: by 2002:a63:6a4a:: with SMTP id f71mr33127590pgc.44.1557776457544; Mon, 13 May 2019 12:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557776457; cv=none; d=google.com; s=arc-20160816; b=RuWmZvQsHpV8/f+99fQohKtYDdSLrdYjHIHeicvmi35IJpa94mm6KxMFmpJue978AN kYpZV63cjrPTcbVQlU19YpkZCYuFUyTSQnOMqWm6sgvtM3x1oapk19ZwvSZyHtVB064C WDRBar40pjJCnEV6Di4jAsnw1b9ZPzGhGpZH6SaKO4A18ptpBUA+17+V++z1IJXz/LdX vePni5yu88MMmFYkoQYvQG+FmerEKGwDaGKZbSfdCQsdiu1wircRjN5/6QRIusx/patm Nqs/PxDRUW25Eghn9LAB42wYzXFdwToecMDjqZ19U4s312VzGi/cpSLItDdfzxUMWMyL 3EfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=aNQB0qvtiJDPOekMEIWJdUXL8B2EPHtpWXUL22B7EP0=; b=a26ylKNkN5dZyt/8MWSrBSlWyVS2HrmGkv7SJNOHTQIJ45GWExyP4i/ld2kXCh/1u1 NqXGJyKhp/gIzkvGnz/yGSlgN2Pfr5gG/RVISyrQ7Ok8laAB6Dkyf6wcWKREMalcQth/ BpKUevuZbDCq0OWlQm6YLG+kZ8hv2rSIbf/V7i2OyaM43rFyhQViocDp33WDaqcCx6N8 iEyz57zGkeqgBSm/b4tAevHnJ76+Z3uzV/7zs6+2s8LFAOZ+zBIBjGkak32L3UlrN3au X1EoSTbNTEOgBd49WWvCN0UyI3531WVfW0yO5SdhAiZG5WYqr6zuSbEFh/+H80N3mFlw 9/tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EDWeZdRQ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si20168942pfb.213.2019.05.13.12.40.41; Mon, 13 May 2019 12:40:57 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EDWeZdRQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732122AbfEMR7g (ORCPT + 99 others); Mon, 13 May 2019 13:59:36 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34046 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727437AbfEMR7b (ORCPT ); Mon, 13 May 2019 13:59:31 -0400 Received: by mail-pl1-f196.google.com with SMTP id w7so6867488plz.1 for ; Mon, 13 May 2019 10:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:organization; bh=aNQB0qvtiJDPOekMEIWJdUXL8B2EPHtpWXUL22B7EP0=; b=EDWeZdRQ4APPef2t/EAB4C+buWvmsO9JTHrs1OKJg8xMJaPLVkrmdkjyX9MM9xv259 G3heh5V+uJSxwOFff9o+7WbKVFcMw9gToRuCORPjJAcKUwhpsGwzsc0Un81w5sFXTsB3 8NCdD8d6Yd5N7s7vDEvEekPfKX7Uq4JPaKFb+AHcZJqv2fW7Vo8a4kT+VahX3Tx+aNfh zRe1CID9V2p29lN9Q5vpkE+P2m2SvMlfNwTd++pjKeWQZYZx4fwcGV3IUFgSMblEdo+c c8n2LujtsT7SsVW64fQZwMhcVbFSI31BU8muWLbKob0n40WwvgVspxHN8R/tl7Crfp3k wt8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:reply-to:organization; bh=aNQB0qvtiJDPOekMEIWJdUXL8B2EPHtpWXUL22B7EP0=; b=InAPhoEmmkWQwA+IfSR8QYSWT14sgfXL0F/DJGlXeX4PbKuHsRg94gilimtjg9POvo BhDSPdWTT/jNc819BrzWFXgXah+o6qMGFuZZ5FLCjdm6+KCfZIrlErsA/7s49bu6Wr9D C5YVU0bsFRr0r6xA8PI1oXMyE1koPFdudmcWl7drA8KuuDOk9yagz7RtWDaDgRI5P4V9 mkp7qtQSOF5sBEwPFdJxpW4GXY0LVgfgPA49xakscgVhBVr3iaN6iB0e/b81TdEEnbaf Rvqia0+IrFDjxFrYJwFVib+KIM1o6pMfr/Y52ZE+v6qaxkxqgGzdPM1EzSgslhouZkVz UStQ== X-Gm-Message-State: APjAAAVXPMhBe5hp3EORyFd1nKNoO6bF+xMXURdBywXqj3EeafbpEE6R w/U10orfmokH9hsNqLDdxdQ= X-Received: by 2002:a17:902:6b:: with SMTP id 98mr32859598pla.271.1557770371423; Mon, 13 May 2019 10:59:31 -0700 (PDT) Received: from localhost.localdomain ([96.79.124.202]) by smtp.gmail.com with ESMTPSA id s12sm9536266pfd.152.2019.05.13.10.59.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 10:59:30 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 11/19] topology: Create package_cpus sysfs attribute Date: Mon, 13 May 2019 13:58:55 -0400 Message-Id: X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <7b23d2d26d717b8e14ba137c94b70943f1ae4b5c.1557769318.git.len.brown@intel.com> References: <7b23d2d26d717b8e14ba137c94b70943f1ae4b5c.1557769318.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Len Brown The existing sysfs cpu/topology/core_siblings (and core_siblings_list) attributes are documented, implemented, and used by programs to represent set of logical CPUs sharing the same package. This makes sense if the next topology level above a core is always a package. But on systems where there is a die topology level between a core and a package, the name and its definition become inconsistent. So without changing its function, add a name for this map that describes what it actually is -- package CPUs -- the set of CPUs that share the same package. This new name will be immune to changes in topology, since it describes threads at the current level, not siblings at a contained level. Signed-off-by: Len Brown Suggested-by: Brice Goglin --- Documentation/cputopology.txt | 12 ++++++------ drivers/base/topology.c | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index 2ff8a1e9a2db..48af5c290e20 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt @@ -46,15 +46,15 @@ thread_siblings_list: human-readable list of cpuX's hardware threads within the same core as cpuX. -core_siblings: +package_cpus: - internal kernel map of cpuX's hardware threads within the same - physical_package_id. + internal kernel map of the CPUs sharing the same physical_package_id. + (deprecated name: "core_siblings") -core_siblings_list: +package_cpus_list: - human-readable list of cpuX's hardware threads within the same - physical_package_id. + human-readable list of CPUs sharing the same physical_package_id. + (deprecated name: "core_siblings_list") book_siblings: diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 50352cf96f85..dc3c19b482f3 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -57,6 +57,10 @@ define_siblings_show_func(core_siblings, core_cpumask); static DEVICE_ATTR_RO(core_siblings); static DEVICE_ATTR_RO(core_siblings_list); +define_siblings_show_func(package_cpus, core_cpumask); +static DEVICE_ATTR_RO(package_cpus); +static DEVICE_ATTR_RO(package_cpus_list); + #ifdef CONFIG_SCHED_BOOK define_id_show_func(book_id); static DEVICE_ATTR_RO(book_id); @@ -81,6 +85,8 @@ static struct attribute *default_attrs[] = { &dev_attr_thread_siblings_list.attr, &dev_attr_core_siblings.attr, &dev_attr_core_siblings_list.attr, + &dev_attr_package_cpus.attr, + &dev_attr_package_cpus_list.attr, #ifdef CONFIG_SCHED_BOOK &dev_attr_book_id.attr, &dev_attr_book_siblings.attr, -- 2.18.0-rc0