All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com, corbet@lwn.net,
	jgross@suse.com, andrew.cooper3@citrix.com, peterz@infradead.org,
	Jason@zx2c4.com, thomas.lendacky@amd.com, puwen@hygon.cn,
	x86@kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 2/2] x86/Documentation: Add documentation about cluster
Date: Tue, 11 Apr 2023 10:58:12 +0700	[thread overview]
Message-ID: <ZDTa1PbEqcyrhJsU@debian.me> (raw)
In-Reply-To: <20230410163527.1626-3-kprateek.nayak@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2374 bytes --]

On Mon, Apr 10, 2023 at 10:05:27PM +0530, K Prateek Nayak wrote:
> diff --git a/Documentation/x86/topology.rst b/Documentation/x86/topology.rst
> index 7f58010ea86a..35991d8cdef1 100644
> --- a/Documentation/x86/topology.rst
> +++ b/Documentation/x86/topology.rst
> @@ -33,6 +33,7 @@ historical nature and should be cleaned up.
>  The topology of a system is described in the units of:
>  
>      - packages
> +    - cluster
>      - cores
>      - threads
>  
> @@ -90,6 +91,27 @@ Package-related topology information in the kernel:
>          Cache. In general, it is a number identifying an LLC uniquely on the
>          system.
>  
> +
> +Clusters
> +========
> +A cluster consists of 1 or more threads. It does not matter whether the threads
> +are SMT- or CMT-type threads. All the threads of a cluster share the same L2
> +cache.
> +
> +Cluster-related topology information in the kernel:
> +
> +  - cluster_id:
> +
> +    A per-CPU variable containing:
> +
> +      - On Intel, the common upper bits of APIC ID of the list of CPUs sharing
> +        the L2 Cache with lower bits set to 0.
> +
> +      - On AMD, with Topology Extension, the common upper bits of the Extended
> +        APIC ID of the list of CPUs sharing the L2 Cache, left shifted to
> +        remove trailing 0s.
> +
> +
>  Cores
>  =====
>  A core consists of 1 or more threads. It does not matter whether the threads
> @@ -125,6 +147,11 @@ Thread-related topology information in the kernel:
>  
>      The number of online threads is also printed in /proc/cpuinfo "siblings."
>  
> +  - topology_cluster_cpumask():
> +
> +    The cpumask contains all online threads in the cluster to which a thread
> +    belongs.
> +
>    - topology_sibling_cpumask():
>  
>      The cpumask contains all online threads in the core to which a thread
> @@ -138,6 +165,10 @@ Thread-related topology information in the kernel:
>  
>      The physical package ID to which a thread belongs.
>  
> +  - topology_cluster_id();
> +
> +    The ID of the cluster to which a thread belongs.
> +
>    - topology_core_id();
>  
>      The ID of the core to which a thread belongs. It is also printed in /proc/cpuinfo

The doc LGTM, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-04-11  3:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 16:35 [PATCH 0/2] arch/x86: Set L2 Cache ID on AMD processors K Prateek Nayak
2023-04-10 16:35 ` [PATCH 1/2] " K Prateek Nayak
2023-04-10 16:35 ` [PATCH 2/2] x86/Documentation: Add documentation about cluster K Prateek Nayak
2023-04-11  3:58   ` Bagas Sanjaya [this message]
2023-04-11 10:57     ` K Prateek Nayak
2023-04-11  8:25   ` Peter Zijlstra
2023-04-11 10:55     ` K Prateek Nayak
     [not found] ` <7d5f81e3-0890-ae35-2e5c-59d1b0950297@hygon.cn>
2023-04-11 12:23   ` [PATCH 0/2] arch/x86: Set L2 Cache ID on AMD processors Borislav Petkov
2023-04-13 13:17 ` Oleksandr Natalenko
2023-04-13 17:33   ` K Prateek Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDTa1PbEqcyrhJsU@debian.me \
    --to=bagasdotme@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=puwen@hygon.cn \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.