Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1141471pxy; Thu, 29 Apr 2021 00:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxecRW50id0rC6xpI9VcMXuNRPHIs4k8VO7ZbXGJG9ilwKfoIjezCf9HapX6XParMkNLpn2 X-Received: by 2002:a05:6402:17:: with SMTP id d23mr3581292edu.63.1619680096587; Thu, 29 Apr 2021 00:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619680096; cv=none; d=google.com; s=arc-20160816; b=cWt6qo39XOSfFXZiEtYSUf8eoZXkgI+g/G7GYOzzBR0X9st1ZgjlQ8lzCVIRsLFnhI 8eka3o1xPaX6l5oAihnXotYbHcyu6GfKs5a/TgrhbLmJw3z0EK3tP7UXPHHbUzpRxbbA /4GyJ1jfdaVgJztX0vV28ovew0d4dBKUxQ0Yf21rQFLS+Z1P23t7kpeRLMQi41RzwneF 2zW6qE3CzbBkREEu2VhsJMyHk+jMmV/jU7f6O5S09ATSMA0LLUsClGCO/ntlwY33sph1 uV5IctUhiGJePghrH1uf1qVwvEZimNLcK/kfGa8I45RCK37ibHX0pWEpZTJ1fHlLI9a8 gpwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=3esQDP+ZpSfsQqV+VIMnrEQQsfgBz7U+vLHRGl/JA/w=; b=jlI+T/rS2YI+MWpT+hUh5T8ATskYwWLDa51S2bYG2w1EOSvZEtK9HkCoLJFnZne8mq YO9p9NWQ40TxqlzG4EfC51FI49dbQwLbxXd+hfjWGtfPhWrKMYn1F2UsR+5nVsYeETIH WPcoKH6W3hytn62dOYX3/YGri7yx8o5RhyTdewxPv74BWMaUIIafJygEI01cCDXZ5Iz2 3msLGHBjBy4/dy1SbE13qP513lFchLGW+xL6IEu6JwdlD/89dcBPsGodngntoaQg2K2s 7mSoMLhGDWFdPmz/jASnlTP1B3Meb69Y/y4Cb22yDJMw6+Lox6DtEZk1jBQ3gmB9sFWq OXQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx25si2010149edb.167.2021.04.29.00.07.53; Thu, 29 Apr 2021 00:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239248AbhD2HE2 (ORCPT + 99 others); Thu, 29 Apr 2021 03:04:28 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:16167 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237274AbhD2HEZ (ORCPT ); Thu, 29 Apr 2021 03:04:25 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FW5x86dzWzpcPn; Thu, 29 Apr 2021 15:00:28 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 15:03:28 +0800 From: Tian Tao To: , , CC: , , Tian Tao Subject: [PATCH 2/2] Documentation/ABI: Move the topology-related sysfs interface to the right place Date: Thu, 29 Apr 2021 15:03:39 +0800 Message-ID: <1619679819-45256-3-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619679819-45256-1-git-send-email-tiantao6@hisilicon.com> References: <1619679819-45256-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the interface that exists under /sys/devices/system/cpu/cpuX/topology/ to the more logical Documentation/ABI/ file that can be properly parsed and displayed to the user space Signed-off-by: Tian Tao --- Documentation/ABI/stable/sysfs-devices-system-cpu | 142 ++++++++++++++++++++++ Documentation/admin-guide/cputopology.rst | 98 +-------------- 2 files changed, 144 insertions(+), 96 deletions(-) diff --git a/Documentation/ABI/stable/sysfs-devices-system-cpu b/Documentation/ABI/stable/sysfs-devices-system-cpu index 33c133e..f63a72d 100644 --- a/Documentation/ABI/stable/sysfs-devices-system-cpu +++ b/Documentation/ABI/stable/sysfs-devices-system-cpu @@ -1,3 +1,7 @@ +Export CPU topology info via sysfs. Items (attributes) are similar +to /proc/cpuinfo output of some architectures. They reside in +/sys/devices/system/cpu/cpuX/topology/: + What: /sys/devices/system/cpu/dscr_default Date: 13-May-2014 KernelVersion: v3.15.0 @@ -23,3 +27,141 @@ Description: Default value for the Data Stream Control Register (DSCR) on here). If set by a process it will be inherited by child processes. Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/physical_package_id +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: physical package id of cpuX. Typically corresponds to a physical + socket number, but the actual value is architecture and platform + dependent. +Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/die_id +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: the CPU die ID of cpuX. Typically it is the hardware platform's + identifier (rather than the kernel's). The actual value is + architecture and platform dependent. +Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/core_id +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: the CPU core ID of cpuX. Typically it is the hardware platform's + identifier (rather than the kernel's). The actual value is + architecture and platform dependent. +Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/book_id +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: the book ID of cpuX. Typically it is the hardware platform's + identifier (rather than the kernel's). The actual value is + architecture and platform dependent. it's only used on s390. +Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/drawer_id +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: the drawer ID of cpuX. Typically it is the hardware platform's + identifier (rather than the kernel's). The actual value is + architecture and platform dependent. it's only used on s390. +Values: 64 bit unsigned integer (bit field) + +What: /sys/devices/system/cpu/cpuX/topology/core_cpus +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: internal kernel map of CPUs within the same core. + (deprecated name: "thread_siblings") +Values: hexadecimal bitmask. + +What: /sys/devices/system/cpu/cpuX/topology/core_cpus_list +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: human-readable list of CPUs within the same core. + The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, + so the tail of the string will be trimmed while its size is larger + than PAGE_SIZE. + (deprecated name: "thread_siblings_list"). +Values: decimal list. + +What: /sys/devices/system/cpu/cpuX/topology/package_cpus +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: internal kernel map of the CPUs sharing the same physical_package_id. + (deprecated name: "core_siblings"). +Values: hexadecimal bitmask. + +What: /sys/devices/system/cpu/cpuX/topology/package_cpus_list +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: human-readable list of CPUs sharing the same physical_package_id. + The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, + so the tail of the string will be trimmed while its size is larger + than PAGE_SIZE. + (deprecated name: "core_siblings_list") +Values: decimal list. + +What: /sys/devices/system/cpu/cpuX/topology/die_cpus +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: internal kernel map of CPUs within the same die. +Values: hexadecimal bitmask. + +What: /sys/devices/system/cpu/cpuX/topology/die_cpus_list +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: human-readable list of CPUs within the same die. + The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, + so the tail of the string will be trimmed while its size is larger + than PAGE_SIZE. +Values: decimal list. + +What: /sys/devices/system/cpu/cpuX/topology/book_siblings +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: internal kernel map of cpuX's hardware threads within the same + book_id. it's only used on s390. +Values: hexadecimal bitmask. + +What: /sys/devices/system/cpu/cpuX/topology/book_siblings_list +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: human-readable list of cpuX's hardware threads within the same + book_id. it's only used on s390. + The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, + so the tail of the string will be trimmed while its size is larger + than PAGE_SIZE. +Values: decimal list. + +What: /sys/devices/system/cpu/cpuX/topology/drawer_siblings +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: internal kernel map of cpuX's hardware threads within the same + drawer_id. it's only used on s390. +Values: hexadecimal bitmask. + +What: /sys/devices/system/cpu/cpuX/topology/drawer_siblings_list +Date: 19-Mar-2021 +KernelVersion: v5.12 +Contact: +Description: human-readable list of cpuX's hardware threads within the same + drawer_id. + The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, + so the tail of the string will be trimmed while its size is larger + than PAGE_SIZE. it's only used on s390. +Values: decimal list. diff --git a/Documentation/admin-guide/cputopology.rst b/Documentation/admin-guide/cputopology.rst index 4538d78..de1995c 100644 --- a/Documentation/admin-guide/cputopology.rst +++ b/Documentation/admin-guide/cputopology.rst @@ -2,102 +2,8 @@ How CPU topology info is exported via sysfs =========================================== -Export CPU topology info via sysfs. Items (attributes) are similar -to /proc/cpuinfo output of some architectures. They reside in -/sys/devices/system/cpu/cpuX/topology/: - -physical_package_id: - - physical package id of cpuX. Typically corresponds to a physical - socket number, but the actual value is architecture and platform - dependent. - -die_id: - - the CPU die ID of cpuX. Typically it is the hardware platform's - identifier (rather than the kernel's). The actual value is - architecture and platform dependent. - -core_id: - - the CPU core ID of cpuX. Typically it is the hardware platform's - identifier (rather than the kernel's). The actual value is - architecture and platform dependent. - -book_id: - - the book ID of cpuX. Typically it is the hardware platform's - identifier (rather than the kernel's). The actual value is - architecture and platform dependent. - -drawer_id: - - the drawer ID of cpuX. Typically it is the hardware platform's - identifier (rather than the kernel's). The actual value is - architecture and platform dependent. - -core_cpus: - - internal kernel map of CPUs within the same core. - (deprecated name: "thread_siblings") - -core_cpus_list: - - human-readable list of CPUs within the same core. - The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, - so the tail of the string will be trimmed while its size is larger - than PAGE_SIZE. - (deprecated name: "thread_siblings_list"); - -package_cpus: - - internal kernel map of the CPUs sharing the same physical_package_id. - (deprecated name: "core_siblings") - -package_cpus_list: - - human-readable list of CPUs sharing the same physical_package_id. - The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, - so the tail of the string will be trimmed while its size is larger - than PAGE_SIZE. - (deprecated name: "core_siblings_list") - -die_cpus: - - internal kernel map of CPUs within the same die. - -die_cpus_list: - - human-readable list of CPUs within the same die. - The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, - so the tail of the string will be trimmed while its size is larger - than PAGE_SIZE. - -book_siblings: - - internal kernel map of cpuX's hardware threads within the same - book_id. - -book_siblings_list: - - human-readable list of cpuX's hardware threads within the same - book_id. - The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, - so the tail of the string will be trimmed while its size is larger - than PAGE_SIZE. - -drawer_siblings: - - internal kernel map of cpuX's hardware threads within the same - drawer_id. - -drawer_siblings_list: - - human-readable list of cpuX's hardware threads within the same - drawer_id. - The format is like 0-3, 8-11, 14,17. The maximum size is PAGE_SIZE, - so the tail of the string will be trimmed while its size is larger - than PAGE_SIZE. +Export CPU topology info via sysfs. Please refer to the ABI file: +Documentation/ABI/stable/sysfs-devices-system-cpu. Architecture-neutral, drivers/base/topology.c, exports these attributes. However, the book and drawer related sysfs files will only be created if -- 2.7.4