Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1527083ybm; Thu, 23 May 2019 02:32:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTnrAFASJO+N2A6Re5ohir0jgYtqw+T03HR9xqS+Vee2dztD9pcumkP5AI/5VcJT7wwusl X-Received: by 2002:a62:ac0c:: with SMTP id v12mr20100506pfe.59.1558603972591; Thu, 23 May 2019 02:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558603972; cv=none; d=google.com; s=arc-20160816; b=vnZp3b6rnlMR8XsmR9Mkl2kfqBnQCppvTeC7p3sIi3EVgw+tZI2dnL/nbh+qh9DRyR 9FVoWNiOGB8cJW+kgdxuWJoqXQ1mVZxxGKv9PR3p8K1QcD6gKGkwGatn8SZHcmMWbGm8 F84sObN/PDzCOebHLOd/ku2/75eXfSdtbgo8iTElBR4e3soWjz6l9NucJ6YYjBhzupus hfimIZYiHLAUEkbbTsnUFxMeGSasbMvjOz+JcBRYQr8E1ZjB6g4EQyrkOXs3KRUEd/h/ YOUn8a8y90c01sp2nNqaQ7Obe8xcLn+Sr9BboV9hbY1R9OWOc8xbAAVgl/pIVuF8zHNQ LwmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=qgM6/UiOOJV7ufSHfkgzdvkTUZg0ZjkUNWfAxuSX/R0=; b=buuesWsBvArb1stNY+xE1rRiIM8dVP/idYBXgNPmT6tJ8QDGn7vCTdQZcOp1Z5pLOt WGtR4YMQyZ4oWbdtr2oHSH40y83FtH3hg2NVSPOtjk9XNthy9MXEcxLCtpsNDD4cZi9p Q2dGaVCd2KhFML/tokxrFVSbURcBHj7aT/r2B6gANc2SLfiJgmtXvC5kCDj7rpHQYLdL iQHVVnfpWkEfR0ms+tReeUfXHIM7gIzmuVXAi/beMXiOHBsdZlWIKR4in1gKvz9v2ujV fqWp0YdwxfNdr/tlmzCk2M2bsBPnO3CiVF8tXdpXkdZe7RzFaFBA3c1CstRPuzNWca6W MVmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=fX+2OgK6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si28054489pgn.428.2019.05.23.02.32.37; Thu, 23 May 2019 02:32:52 -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=pass header.i=@zytor.com header.s=2019051801 header.b=fX+2OgK6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730366AbfEWJaD (ORCPT + 99 others); Thu, 23 May 2019 05:30:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40617 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbfEWJaD (ORCPT ); Thu, 23 May 2019 05:30:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x4N9TmPj4042301 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 02:29:48 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x4N9TmPj4042301 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1558603789; bh=qgM6/UiOOJV7ufSHfkgzdvkTUZg0ZjkUNWfAxuSX/R0=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=fX+2OgK6C+zjN00IXJiml5ZfXURx7bTkG/ed+Q7T24AU/rdBBFcHJxJXYhDPfElvm sfWf8PeANgo4m69awrWtorgilrxmauJbrZ+ix/i0r6Mmh1ma+Hzy4dtDXQ6IkXf85A /uNvmRFl5D0ymUOQZZ9vdguSVbgawpBdQM3U93li+vKMJDTPBrhCNmdBZabAbambWz XEoozbWuyp2X85x1Vb1CQ/8RTcoazFwbbJPgWMjKPdFIT2/TnwMw3iKrXyUOjBPPaN 0kMA6t4IUjlT/seqscX2Vsht70awAy4XL1XVmyOv4DXoqUfIlwfpUxnaHd7W4q4urX P/tLkDJQOSr9g== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x4N9TlsP4042284; Thu, 23 May 2019 02:29:47 -0700 Date: Thu, 23 May 2019 02:29:47 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Len Brown Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, Brice.Goglin@inria.fr, peterz@infradead.org, tglx@linutronix.de, len.brown@intel.com, mingo@kernel.org Reply-To: mingo@kernel.org, len.brown@intel.com, tglx@linutronix.de, Brice.Goglin@inria.fr, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/topology] topology: Create package_cpus sysfs attribute Git-Commit-ID: b73ed8dc0597c11ec5064d06b9bbd4e541b6d4e7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b73ed8dc0597c11ec5064d06b9bbd4e541b6d4e7 Gitweb: https://git.kernel.org/tip/b73ed8dc0597c11ec5064d06b9bbd4e541b6d4e7 Author: Len Brown AuthorDate: Mon, 13 May 2019 13:58:55 -0400 Committer: Thomas Gleixner CommitDate: Thu, 23 May 2019 10:08:34 +0200 topology: Create package_cpus sysfs attribute 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. Suggested-by: Brice Goglin Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/d9d3228b82fb5665e6f93a0ccd033fe022558521.1557769318.git.len.brown@intel.com --- 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,