linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <seakeel@gmail.com>
To: Tao Zou <wodemia@foxmail.com>, Alex Shi <alexs@kernel.org>,
	Yanteng Si <siyanteng@loongson.cn>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Tao Zou <wodemia@linux.alibaba.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] zh_CN/admin-guide: Add zh_CN/admin-guide/numastat.rst translation document
Date: Thu, 20 Jun 2024 11:18:45 +0800	[thread overview]
Message-ID: <5f6bd005-81b4-4e26-ae43-803448a0dbbf@gmail.com> (raw)
In-Reply-To: <tencent_6C54200469B1518482F88605A0980FBFD20A@qq.com>



On 6/20/24 11:14 AM, Tao Zou wrote:
> From: Tao Zou <wodemia@linux.alibaba.com>
> 
> Add translation zh_CN/admin-guide/numastat.rst and link it to
> zh_CN/admin-guide/index.rst while clean its todo entry.
> 
> commit 77691ee92d4a ("Documentation: update numastat explanation")
> 
> Signed-off-by: Tao Zou <wodemia@linux.alibaba.com>
> Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  .../translations/zh_CN/admin-guide/index.rst  |  2 +-
>  .../zh_CN/admin-guide/numastat.rst            | 48 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/translations/zh_CN/admin-guide/numastat.rst
> 
> diff --git a/Documentation/translations/zh_CN/admin-guide/index.rst b/Documentation/translations/zh_CN/admin-guide/index.rst
> index ac2960da33e6..0db80ab830a0 100644
> --- a/Documentation/translations/zh_CN/admin-guide/index.rst
> +++ b/Documentation/translations/zh_CN/admin-guide/index.rst
> @@ -68,6 +68,7 @@ Todolist:
>     cpu-load
>     cputopology
>     lockup-watchdogs
> +   numastat
>     unicode
>     sysrq
>     mm/index
> @@ -109,7 +110,6 @@ Todolist:
>  *   module-signing
>  *   mono
>  *   namespaces/index
> -*   numastat
>  *   parport
>  *   perf-security
>  *   pm/index
> diff --git a/Documentation/translations/zh_CN/admin-guide/numastat.rst b/Documentation/translations/zh_CN/admin-guide/numastat.rst
> new file mode 100644
> index 000000000000..817043676c90
> --- /dev/null
> +++ b/Documentation/translations/zh_CN/admin-guide/numastat.rst
> @@ -0,0 +1,48 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +.. include:: ../disclaimer-zh_CN.rst
> +
> +:Original: Documentation/admin-guide/numastat.rst
> +:Translator: Tao Zou <wodemia@linux.alibaba.com>
> +
> +
> +=======================
> +Numa策略命中/未命中统计
> +=======================
> +
> +/sys/devices/system/node/node*/numastat
> +
> +所有数据的单位都是页面。巨页有独立的计数器。
> +
> +numa_hit、numa_miss和numa_foreign计数器反应了进程是否能够在他们偏好的节点上分配内存。
> +如果进程成功在偏好的节点上分配内存则在偏好的节点上增加numa_hit计数,否则在偏好的节点上增
> +加numa_foreign计数同时在实际内存分配的节点上增加numa_miss计数。
> +
> +通常,偏好的节点是进程运行所在的CPU的本地节点,但是一些限制可以改变这一行为,比如内存策略,
> +因此同样有两个基于CPU本地节点的计数器。local_node和numa_hit类似,当在CPU所在的节点上分
> +配内存时增加local_node计数,other_node和numa_miss类似,当在CPU所在节点之外的其他节点
> +上成功分配内存时增加other_node计数。需要注意,没有和numa_foreign对应的计数器。
> +
> +更多细节内容:
> +
> +=============== ============================================================
> +numa_hit        一个进程想要从本节点分配内存并且成功。
> +
> +numa_miss       一个进程想要从其他节点分配内存但是最终在本节点完成内存分配。
> +
> +numa_foreign    一个进程想要在本节点分配内存但是最终在其他节点完成内存分配。
> +
> +local_node      一个进程运行在本节点的CPU上并且从本节点上获得了内存。
> +
> +other_node      一个进程运行在其他节点的CPU上但是在本节点上获得了内存。
> +
> +interleave_hit  内存交叉分配策略下想要从本节点分配内存并且成功。
> +=============== ============================================================
> +
> +你可以使用numactl软件包(http://oss.sgi.com/projects/libnuma/)中的numastat工具
> +来辅助阅读。需要注意,numastat工具目前只在有少量CPU的机器上运行良好。
> +
> +需要注意,在有无内存节点(一个节点有CPUs但是没有内存)的系统中numa_hit,numa_miss和

s/在有无内存节点/存在无内存节点/ ?

Thanks
Alex
> +numa_foreign统计数据会被严重曲解。在当前的内核实现中,如果一个进程偏好一个无内存节点(即
> +进程正在该节点的一个本地CPU上运行),实际上会从距离最近的有内存节点中挑选一个作为偏好节点。
> +结果会导致相应的内存分配不会增加无内存节点上的numa_foreign计数器,并且会扭曲最近节点上的
> +numa_hit、numa_miss和numa_foreign统计数据。

  reply	other threads:[~2024-06-20  3:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  3:14 [PATCH v3] zh_CN/admin-guide: Add zh_CN/admin-guide/numastat.rst translation document Tao Zou
2024-06-20  3:18 ` Alex Shi [this message]
2024-06-20  5:53   ` Tao Zou
     [not found]   ` <8BF94CA3-B91D-462E-A5EC-A4CCAFED4B9A@linux.alibaba.com>
2024-06-20  6:20     ` Alex Shi
2024-06-20  6:40       ` Tao Zou

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=5f6bd005-81b4-4e26-ae43-803448a0dbbf@gmail.com \
    --to=seakeel@gmail.com \
    --cc=alexs@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=siyanteng@loongson.cn \
    --cc=wodemia@foxmail.com \
    --cc=wodemia@linux.alibaba.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).