Thread (5 messages) 5 messages, 3 authors, 2021-12-16

Re: [PATCH] docs/zh_CN: Add cputopology Chinese translation

From: Alex Shi <hidden>
Date: 2021-12-15 03:49:42

On Wed, Dec 15, 2021 at 10:12 AM Tang Yizhou [off-list ref] wrote:
On 2021/12/15 10:29, Tang Yizhou wrote:
quoted
Translate admin-guide/cputopology.rst into Chinese.

Signed-off-by: Tang Yizhou <redacted>
---
 .../zh_CN/admin-guide/cputopology.rst         | 94 +++++++++++++++++++
 .../translations/zh_CN/admin-guide/index.rst  |  2 +-
 2 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/admin-guide/cputopology.rst
diff --git a/Documentation/translations/zh_CN/admin-guide/cputopology.rst b/Documentation/translations/zh_CN/admin-guide/cputopology.rst
new file mode 100644
index 000000000000..f8d5c5025330
--- /dev/null
+++ b/Documentation/translations/zh_CN/admin-guide/cputopology.rst
@@ -0,0 +1,94 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/admin-guide/cputopology.rst
+
+:翻译:
+
+  唐艺舟 Tang Yizhou <tangyeechou@gmail.com>
+
+==========================
+如何通过sysfs将CPU拓扑导出
+==========================
+
+CPU拓扑信息通过sysfs导出。显示的项(属性)和某些架构的/proc/cpuinfo输出相似。它们位于
+/sys/devices/system/cpu/cpuX/topology/。请阅读ABI文件:
+Documentation/ABI/stable/sysfs-devices-system-cpu。
+
+drivers/base/topology.c是体系结构中性的,它导出了这些属性。然而,die、cluster、book、
+draw这些层次结构相关的文件仅在体系结构提供了下文描述的宏的条件下被创建。
+
+对于支持这个特性的体系结构,它必须在include/asm-XXX/topology.h中定义这些宏中的一部分::
+
+     #define topology_physical_package_id(cpu)
+     #define topology_die_id(cpu)
+     #define topology_cluster_id(cpu)
+     #define topology_core_id(cpu)
+     #define topology_book_id(cpu)
+     #define topology_drawer_id(cpu)
+     #define topology_sibling_cpumask(cpu)
+     #define topology_core_cpumask(cpu)
+     #define topology_cluster_cpumask(cpu)
+     #define topology_die_cpumask(cpu)
+     #define topology_book_cpumask(cpu)
+     #define topology_drawer_cpumask(cpu)
+
+``**_id macros`` 的类型是int。
+``**_cpumask macros`` 的类型是 ``(const) struct cpumask *`` 。后者和恰当的
+``**_siblings`` sysfs属性对应(除了topology_sibling_cpumask(),它和thread_siblings
+对应)。
+
+为了在所有体系结构上保持一致,include/linux/topology.h提供了上述所有宏的默认定义,以防
+它们未在include/asm-XXX/topology.h中定义:
+
+1) topology_physical_package_id: -1
+2) topology_die_id: -1
+3) topology_cluster_id: -1
+4) topology_core_id: 0
+5) topology_book_id: -1
+6) topology_drawer_id: -1
+7) topology_sibling_cpumask: 仅入参CPU
+8) topology_core_cpumask: 仅入参CPU
+9) topology_cluster_cpumask: 仅入参CPU
+10) topology_die_cpumask: 仅入参CPU
+11) topology_book_cpumask:  仅入参CPU
+12) topology_drawer_cpumask: 仅入参CPU
+
+此外,CPU拓扑信息由/sys/devices/system/cpu提供,包含下述文件。输出对应的内部数据源放在
+方括号("[]")中。
+
+    =========== ==================================================
+    kernel_max: 内核配置允许的最大CPU下标值。[NR_CPUS-1]
+
+    offline:    由于热插拔移除或者超过内核允许的CPU上限(上文描述的kernel_max)导致未上线的CPU。[~cpu_online_mask + cpus >= NR_CPUS]
Here is an example of poor Chinese support. If a line break is made here,
*make htmldocs* warns 'Malformed table'.
Thanks for the info.

Compare to the warning and a space in webpage, I'd prefer using line break for
a neat source doc. Guess Jon would consider and permit this.
Meanwhile, the number of '=' can be inconsistent with the number of Chinese
chars and there won't be any warnings. I've already checked the HTML page,
the rendering effect is OK.
Uh, that's a bit inconvenitent for us. we'd better to double check the
'=' to make
sure it fit the chars number correctly.

Thanks
Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help