All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yanteng Si <siyanteng01@gmail.com>
To: corbet@lwn.net, alexs@kernel.org, seakeel@gmail.com
Cc: Yanteng Si <siyanteng01@gmail.com>,
	chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
	linux-doc@vger.kernel.org, Yanteng Si <siyanteng@loongson.cn>
Subject: [PATCH v3 05/12] docs/zh_CN: add vm overcommit-accounting translation
Date: Mon, 28 Mar 2022 17:59:47 +0800	[thread overview]
Message-ID: <3aa0251058c5f2f13946a0295ba0fccc3a58c5c0.1648458742.git.siyanteng@loongson.cn> (raw)
In-Reply-To: <cover.1648458742.git.siyanteng@loongson.cn>

From: Yanteng Si <siyanteng01@gmail.com>

Translate .../vm/overcommit-accounting.rst into Chinese.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Reviewed-by: Alex Shi <alexs@kernel.org>
---
 Documentation/translations/zh_CN/vm/index.rst |  2 +-
 .../zh_CN/vm/overcommit-accounting.rst        | 86 +++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/vm/overcommit-accounting.rst

diff --git a/Documentation/translations/zh_CN/vm/index.rst b/Documentation/translations/zh_CN/vm/index.rst
index 1fb80aa7a08b..1c6ec847a2f3 100644
--- a/Documentation/translations/zh_CN/vm/index.rst
+++ b/Documentation/translations/zh_CN/vm/index.rst
@@ -31,6 +31,7 @@ TODO:待引用文档集被翻译完毕后请及时修改此处)
    hwpoison
    memory-model
    mmu_notifier
+   overcommit-accounting
 
 TODOLIST:
 * arch_pgtable_helpers
@@ -38,7 +39,6 @@ TODOLIST:
 * hmm
 * hugetlbfs_reserv
 * numa
-* overcommit-accounting
 * page_migration
 * page_frags
 * page_owner
diff --git a/Documentation/translations/zh_CN/vm/overcommit-accounting.rst b/Documentation/translations/zh_CN/vm/overcommit-accounting.rst
new file mode 100644
index 000000000000..8765cb118f24
--- /dev/null
+++ b/Documentation/translations/zh_CN/vm/overcommit-accounting.rst
@@ -0,0 +1,86 @@
+:Original: Documentation/vm/overcommit-accounting.rst
+
+:翻译:
+
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
+
+:校译:
+
+
+
+==============
+超量使用审计
+==============
+
+Linux内核支持下列超量使用处理模式
+
+0
+	启发式超量使用处理。拒绝明显的地址空间超量使用。用于一个典型的系统。
+	它确保严重的疯狂分配失败,同时允许超量使用以减少swap的使用。在这种模式下,
+	允许root分配稍多的内存。这是默认的。
+1
+	总是超量使用。适用于一些科学应用。经典的例子是使用稀疏数组的代码,只是依赖
+	几乎完全由零页组成的虚拟内存
+
+2
+	不超量使用。系统提交的总地址空间不允许超过swap+一个可配置的物理RAM的数量
+	(默认为50%)。根据你使用的数量,在大多数情况下,这意味着一个进程在访问页面时
+	不会被杀死,但会在内存分配上收到相应的错误。
+
+	对于那些想保证他们的内存分配在未来可用而又不需要初始化每一个页面的应用程序来说
+	是很有用的。
+
+超量使用策略是通过sysctl  `vm.overcommit_memory` 设置的。
+
+可以通过 `vm.overcommit_ratio` (百分比)或 `vm.overcommit_kbytes` (绝对值)
+来设置超限数量。这些只有在 `vm.overcommit_memory` 被设置为2时才有效果。
+
+在 ``/proc/meminfo`` 中可以分别以CommitLimit和Committed_AS的形式查看当前
+的超量使用和提交量。
+
+陷阱
+====
+
+C语言的堆栈增长是一个隐含的mremap。如果你想得到绝对的保证,并在接近边缘的地方运行,
+你 **必须** 为你认为你需要的最大尺寸的堆栈进行mmap。对于典型的堆栈使用来说,这并
+不重要,但如果你真的非常关心的话,这就是一个值得关注的案例。
+
+
+在模式2中,MAP_NORESERVE标志被忽略。
+
+
+它是如何工作的
+==============
+
+超量使用是基于以下规则
+
+对于文件映射
+	| SHARED or READ-only	-	0 cost (该文件是映射而不是交换)
+	| PRIVATE WRITABLE	-	每个实例的映射大小
+
+对于匿名或者 ``/dev/zero`` 映射
+	| SHARED			-	映射的大小
+	| PRIVATE READ-only	-	0 cost (但作用不大)
+	| PRIVATE WRITABLE	-	每个实例的映射大小
+
+额外的计数
+	| 通过mmap制作可写副本的页面
+	| 从同一池中提取的shmfs内存
+
+状态
+====
+
+*	我们核算mmap内存映射
+*	我们核算mprotect在提交中的变化
+*	我们核算mremap的大小变化
+*	我们的审计 brk
+*	审计munmap
+*	我们在/proc中报告commit 状态
+*	核对并检查分叉的情况
+*	审查堆栈处理/执行中的构建
+*	叙述SHMfs的情况
+*	实现实际限制的执行
+
+待续
+====
+*	ptrace 页计数(这很难)。
-- 
2.27.0


  parent reply	other threads:[~2022-03-28  9:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  9:59 [PATCH v3 00/12] docs/zh_CN: add a little vm translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 01/12] docs/zh_CN: add vm frontswap translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 02/12] docs/zh_CN: add vm hwpoison translation Yanteng Si
2022-03-28 12:19   ` Alex Shi
2022-03-28  9:59 ` [PATCH v3 03/12] docs/zh_CN: add vm memory-model translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 04/12] docs/zh_CN: add vm mmu_notifier translation Yanteng Si
2022-03-28  9:59 ` Yanteng Si [this message]
2022-03-28  9:59 ` [PATCH v3 06/12] docs/zh_CN: add vm page_frags translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 07/12] docs/zh_CN: add vm page_owner translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 08/12] docs/zh_CN: add vm page_table_check translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 09/12] docs/zh_CN: add vm remap_file_pages translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 10/12] docs/zh_CN: add vm split_page_table_lock translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 11/12] docs/zh_CN: add vm z3fold translation Yanteng Si
2022-03-28  9:59 ` [PATCH v3 12/12] docs/zh_CN: add vm zsmalloc translation Yanteng Si
2022-04-05 16:13 ` [PATCH v3 00/12] docs/zh_CN: add a little vm translation Jonathan Corbet

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=3aa0251058c5f2f13946a0295ba0fccc3a58c5c0.1648458742.git.siyanteng@loongson.cn \
    --to=siyanteng01@gmail.com \
    --cc=alexs@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=seakeel@gmail.com \
    --cc=siyanteng@loongson.cn \
    /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.