Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2955286yba; Mon, 6 May 2019 14:30:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9Q1wC14jbOjjMJ5WiZbus3K9VKoAVpzMvAJZw+ZeA1A3hDWyZqL5Q3pyWcWqrCIdQHX4d X-Received: by 2002:a63:2943:: with SMTP id p64mr35529318pgp.151.1557178237557; Mon, 06 May 2019 14:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557178237; cv=none; d=google.com; s=arc-20160816; b=gHSlClXfL5SqSTwd0WeUiCNrGhdq8cZgaN+ck/8xVflbDqTTPcsSVuGNJrgMEUwqG8 x3yKYA35Db3KJhKDaBRms6f0rgAvR668vsQghqDU4h6154jUkK4JgwbckVn1Cpu8LdEZ 5JcO/gUvDw6xH98cLeyJaHepZ3CPWCNdrNXxLGnfLU4NJX0zohfxgDaqI/vAZjxX+SVq 8te+Vk4YacyL44BxQYmvRdz2b7ghj2oArGlzQ5pkB04zq0CIXhtZMyq8BA0HM1Ro7Yki KFduYkOd558t3vD6ONrVuFzVzkmiwp9knr16dfjap/NkkDSQdUuoJBIY/WCTJZjZljZg AKxQ== 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=zvKOW0njAL4XtXzoita2eKaEJz7DSCc+RS8KOqLQd30qMrFw/TOmbbc22C+oGwOELT YU1+Bg8yaqMis+QLgJxKulR+K4VKqWqNZoSJc0kDq25CxbWxLprHQmNBvXLf2bXuRrrt A9BWkrDS0wu7IzIyM/DUQHgDk4lY6ERPffq8LXb0f9Umf88zCTxrwrX7HgF+rBtON54n mSuIb+Ka4jXgIl4LMY8tGft1lnuNgNcKQUBnupc/exfQTZyacfdH9JBBDhiEpNgMbt5T HRZ7ylq7WktLHsReV/hLFZ71WbiFLfEyDrORDrt5AYgVGwZwLel6EXIQ8E6Ta6JcN4O/ 0/Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=h6Idtkqh; 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 n3si5894465pgh.53.2019.05.06.14.30.22; Mon, 06 May 2019 14:30:37 -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=h6Idtkqh; 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 S1727129AbfEFV1k (ORCPT + 99 others); Mon, 6 May 2019 17:27:40 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:36813 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbfEFV0n (ORCPT ); Mon, 6 May 2019 17:26:43 -0400 Received: by mail-it1-f193.google.com with SMTP id o190so5226727itc.1 for ; Mon, 06 May 2019 14:26:43 -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=h6IdtkqhYcafRAYS+YtQLPEbvhnMYZTW0xZ/0AEgyOPpvNi4zn45O/KXEmlsHqIRMM Rpu49KF4HnS2vbhdL85UGu7GgGOjyr5+v/troZvGwJ2toW25rzPsltUOiH59G7kb0fMG iv1aWk+fqmscbVuHdM3cG2+0rB4VP5IuasABZlG16GvNyBJcaroz6QBlMiIF/YGUDYfw ZSAECgrb/9Grt74rD5+ga46hbY4A5yDiVgAPfwEqCaiRb4xhkvBmgAzhW8nVWGRLEY/Q 2ld6u0xu3Fmx9w/+mv6XPDgtBrVSXj/NY3qWJNZXnb0P90fDDZw1qL2Oue0KJINzekvy NIpw== 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=cllzKC0jUxkFhERTlMfennleh6Xifs0uScVCThu4Udw9TXINHSBpB/GKR1VHVr0v8N eh/gbw9qE/Phh5T6QbO48TvIxtJkHK9r6Wuz35TAGHqDvR5eZc0mHOEtWuHw0KID/1R+ UkZpUB9IG896fPzWWHw0mbUJgB8cPWGrSTjpdKYgRiPvg4lZ+qn+dEUO79NLqtrntsVn jo/MOTRmzg0yk7rghKEU8Cz3pRRtysjoagLae6lemyHldsyr0GgwmdDQytNo6MO/hz5x lrDxYc9FbZWpz8sG+8IfBfbWU9tgqosM64FXTQdsBLeOPHCapIrItVF8Ix3DvrzxvQXo +ihQ== X-Gm-Message-State: APjAAAWH0Hh8dcvCKrOVGNYpCDweXk/Jm1qbBCdnjMnHE737K2GRH5cb 5DtUxknBzi66HsORsnCT9sU= X-Received: by 2002:a24:8207:: with SMTP id t7mr21759465itd.78.1557178003004; Mon, 06 May 2019 14:26:43 -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 v25sm4268009ioh.81.2019.05.06.14.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 14:26:42 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 14/22] topology: Create package_cpus sysfs attribute Date: Mon, 6 May 2019 17:26:09 -0400 Message-Id: X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.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