Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5723479yba; Tue, 30 Apr 2019 21:26:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0/+kXTHxtdeT/bYTND0NfXZKmUU4xdLPvNcnRXjautFcN3Ll8OBkbNWv7iVCDXgwII56q X-Received: by 2002:a63:b0b:: with SMTP id 11mr37001568pgl.445.1556684802797; Tue, 30 Apr 2019 21:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556684802; cv=none; d=google.com; s=arc-20160816; b=sIcEZ6UDvbinzWoIIX6Icnz4jK4v4HrKc2YPLWP4tN1a8mSTqIc9iRJ0Df6fiuKIYG 6FG+7SlXK95bviLQ3lytlF+Po14RLGLaal2+y4ZNdiksJXEHTxxeYckPsSsVX1AUyRm4 +VzzlXP49hxE5OgP5P139GSasUoPJBRays35uMomMV/wSOM4hvjrFsfRmmM2TRFmP+Mp HwjvtBBTX1bOW9je9laggvD9GBwlc5f0UkzO6RzHFLccAdLu+dnubtD1v1QA7WN7OdIs /BGdy4lFTVMHkFL13s3gH8mqJ6ZPBabVY7LVm4gi4urC1sFtanKibAIemPmnLwT1l2jQ d+AQ== 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=xMvvuTIdXLuAqRSzpIhyzwagWkMXv8bgZbzcZbYSo2tFQmfPdTo2ggA3yNipHv6tFU rcm/WuUcmOGMvic03W2MDcOYb0RA24ay6rHqbmkzD6wuwEDRM/HLCKiyIriF6+bQ/nCp Das7oRAQCa7EqRKp7Zg/lTRzXr9On5vQb+C97EKHk+z+kcNn/EGVt4HjA8JzYbSYVwrh 2eLxOeTJmimjDaFyhc2SE286tBUMovHdxbSuyNGH1s/otJ3d6vSYKjo5pN5Z8xMjzjkU JdfoOWXN76eOH1Exp6LQJNI7F99zhzyCnm8XXaK/fuaN2tCpcRlUcIcPWSwk296De5AS 2eog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bXPq+uYZ; 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 q5si37455793pga.498.2019.04.30.21.26.27; Tue, 30 Apr 2019 21:26:42 -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=bXPq+uYZ; 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 S1726352AbfEAEYw (ORCPT + 99 others); Wed, 1 May 2019 00:24:52 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:38685 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbfEAEYv (ORCPT ); Wed, 1 May 2019 00:24:51 -0400 Received: by mail-it1-f193.google.com with SMTP id q19so8386587itk.3 for ; Tue, 30 Apr 2019 21:24:51 -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=bXPq+uYZBllNp89Ncns5MG2LqYR1C1A1rOSBdvHs+5oJ/NitdfplPmEEINCKRZ8IVi gIBbdyBYUBqe2+HAE8HBBXcmvBjJYaz/BxkC8oL9rnCGmXMWdw7NXEqXi6qf+IluO6ns eNHqY5GYXs/ppadxm2tK4IL8JIPG6i1MgNT3WGY1TVpqN5BGZlPO9q/sB3mB0Lufw7le 0C2lQYSwqC5P4v3DH1L8PzCylu+UtduWSdidbtOTuzoj4aK+AWL1Nv0iaJF3Cur6AvFe ki0aLVYJMatFVsmsYOz+AwMGF3MImwdhMjhu8nz8RjcQb+YDohdooG9s+Y3gu97bmtxD iTgQ== 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=FuVxgsm3OoQ071eeCgXKfbjxk48LA++x2GcqLnF8dosjL5xo8vYdGeKpAhDYd8SHac GoeZarIS/LwuOnuiL8JhuvaQDtFxMSFzN8BxJmi41pEvJuAQfXvlkpKlko4kz+TzF8fH KmW5YjXycgXIhSdQShqF0Hj9TlCsbXw32WVbLSW6L0YaLnTzBSSnVWPjupRJ/2d4wGdX vxz/r6U4ooonIf7XcTHtHILF86+WPFRRvt+bz1/CIoy6jiCIPQRViSVC3fNRcc8Xjw// FcyrgbfWlkIVAdYB5BEzX0uRpqfMTHYhx/DUnliw8+hrY1AHFuXja2/60G8gsPNAuiuT dZ0w== X-Gm-Message-State: APjAAAXTqtuv2I+dS94jcLml7I6F1UBvp4mY/uDP9iopGDhV2cqrI/gO qljrJpaOap9IEc5NtWT0hRM= X-Received: by 2002:a05:6638:94:: with SMTP id v20mr2781901jao.2.1556684690828; Tue, 30 Apr 2019 21:24:50 -0700 (PDT) Received: from nuc8.lan (h69-131-112-51.cntcnh.dsl.dynamic.tds.net. [69.131.112.51]) by smtp.gmail.com with ESMTPSA id b8sm2569728itb.20.2019.04.30.21.24.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 21:24:50 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 14/18] topology: Create package_cpus sysfs attribute Date: Wed, 1 May 2019 00:24:23 -0400 Message-Id: <3ac58ab3d2973b77997c8865cd2e181c6708540a.1556657368.git.len.brown@intel.com> X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1556657368.git.len.brown@intel.com> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1556657368.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