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 v2 06/12] docs/zh_CN: add vm page_frags translation
Date: Thu, 17 Mar 2022 14:50:47 +0800	[thread overview]
Message-ID: <c0c9599c28a3e2a428cb8191f01dde6ce8b40d81.1647498763.git.siyanteng@loongson.cn> (raw)
In-Reply-To: <cover.1647498763.git.siyanteng@loongson.cn>

From: Yanteng Si <siyanteng01@gmail.com>

Translate .../vm/page_frags.rst into Chinese.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 Documentation/translations/zh_CN/vm/index.rst |  2 +-
 .../translations/zh_CN/vm/page_frags.rst      | 38 +++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/vm/page_frags.rst

diff --git a/Documentation/translations/zh_CN/vm/index.rst b/Documentation/translations/zh_CN/vm/index.rst
index 1c6ec847a2f3..f478032cd477 100644
--- a/Documentation/translations/zh_CN/vm/index.rst
+++ b/Documentation/translations/zh_CN/vm/index.rst
@@ -32,6 +32,7 @@ TODO:待引用文档集被翻译完毕后请及时修改此处)
    memory-model
    mmu_notifier
    overcommit-accounting
+   page_frags
 
 TODOLIST:
 * arch_pgtable_helpers
@@ -40,7 +41,6 @@ TODOLIST:
 * hugetlbfs_reserv
 * numa
 * page_migration
-* page_frags
 * page_owner
 * page_table_check
 * remap_file_pages
diff --git a/Documentation/translations/zh_CN/vm/page_frags.rst b/Documentation/translations/zh_CN/vm/page_frags.rst
new file mode 100644
index 000000000000..ad27fed33634
--- /dev/null
+++ b/Documentation/translations/zh_CN/vm/page_frags.rst
@@ -0,0 +1,38 @@
+:Original: Documentation/vm/page_frag.rst
+
+:翻译:
+
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
+
+:校译:
+
+
+========
+页面片段
+========
+
+一个页面片段是一个任意长度的任意偏移的内存区域,它位于一个0或更高阶的复合页面中。
+该页中的多个碎片在该页的引用计数器中被单独计算。
+
+page_frag函数,page_frag_alloc和page_frag_free,为页面片段提供了一个简单
+的分配框架。这被网络堆栈和网络设备驱动使用,以提供一个内存的支持区域,作为
+sk_buff->head使用,或者用于skb_shared_info的 “frags” 部分。
+
+为了使用页面片段API,需要一个支持页面片段的缓冲区。这为碎片分配提供了一个中心点,
+并允许多个调用使用一个缓存的页面。这样做的好处是可以避免对get_page的多次调用,
+这在分配时开销可能会很大。然而,由于这种缓存的性质,要求任何对缓存的调用都要受到每
+个CPU的限制,或者每个CPU的限制,并在执行碎片分配时强制禁止中断。
+
+网络堆栈在每个CPU使用两个独立的缓存来处理碎片分配。netdev_alloc_cache被使用
+netdev_alloc_frag和__netdev_alloc_skb调用的调用者使用。napi_alloc_cache
+被调用__napi_alloc_frag和__napi_alloc_skb的调用者使用。这两个调用的主要区别是
+它们可能被调用的环境。“netdev” 前缀的函数可以在任何上下文中使用,因为这些函数
+将禁用中断,而 ”napi“ 前缀的函数只可以在softirq上下文中使用。
+
+许多网络设备驱动程序使用类似的方法来分配页面片段,但页面片段是在环或描述符级别上
+缓存的。为了实现这些情况,有必要提供一种拆解页面缓存的通用方法。出于这个原因,
+__page_frag_cache_drain被实现了。它允许通过一次调用从一个页面释放多个引用。
+这样做的好处是,它允许清理被添加到一个页面的多个引用,以避免每次分配都调用
+get_page。
+
+Alexander Duyck,2016年11月29日。
-- 
2.27.0


  parent reply	other threads:[~2022-03-17  6:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  6:50 [PATCH v2 00/12] docs/zh_CN: add a little vm translation Yanteng Si
2022-03-17  6:50 ` [PATCH v2 01/12] docs/zh_CN: add vm frontswap translation Yanteng Si
2022-03-17  6:50 ` [PATCH v2 02/12] docs/zh_CN: add vm hwpoison translation Yanteng Si
2022-03-17  6:50 ` [PATCH v2 03/12] docs/zh_CN: add vm memory-model translation Yanteng Si
2022-03-17  6:50 ` [PATCH v2 04/12] docs/zh_CN: add vm mmu_notifier translation Yanteng Si
2022-03-23 12:43   ` Alex Shi
2022-03-28  8:18     ` yanteng si
2022-03-17  6:50 ` [PATCH v2 05/12] docs/zh_CN: add vm overcommit-accounting translation Yanteng Si
2022-03-22  8:01   ` Alex Shi
2022-03-17  6:50 ` Yanteng Si [this message]
2022-03-22  7:58   ` [PATCH v2 06/12] docs/zh_CN: add vm page_frags translation Alex Shi
2022-03-17  6:50 ` [PATCH v2 07/12] docs/zh_CN: add vm page_owner translation Yanteng Si
2022-03-22  7:53   ` Alex Shi
2022-03-17  6:50 ` [PATCH v2 08/12] docs/zh_CN: add vm page_table_check translation Yanteng Si
2022-03-22  7:50   ` Alex Shi
2022-03-17  6:50 ` [PATCH v2 09/12] docs/zh_CN: add vm remap_file_pages translation Yanteng Si
2022-03-22  7:47   ` Alex Shi
2022-03-28  8:30     ` yanteng si
2022-03-17  6:50 ` [PATCH v2 10/12] docs/zh_CN: add vm split_page_table_lock translation Yanteng Si
2022-03-22  7:44   ` Alex Shi
2022-03-17  6:50 ` [PATCH v2 11/12] docs/zh_CN: add vm z3fold translation Yanteng Si
2022-03-22  7:38   ` Alex Shi
2022-03-28  8:33     ` yanteng si
2022-03-17  6:50 ` [PATCH v2 12/12] docs/zh_CN: add vm zsmalloc translation Yanteng Si
2022-03-22  7:31   ` Alex Shi

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=c0c9599c28a3e2a428cb8191f01dde6ce8b40d81.1647498763.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.