All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wu X.C." <bobwxc@email.cn>
To: Yanteng Si <siyanteng@loongson.cn>
Cc: corbet@lwn.net, alexs@kernel.org, seakeel@gmail.com,
	chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
	linux-doc@vger.kernel.org, siyanteng01@gmail.com
Subject: Re: [PATCH v3 1/2] docs/zh_CN: add vm page_migration translation
Date: Tue, 17 May 2022 11:24:49 +0800	[thread overview]
Message-ID: <YoMVgfGXMSyLdCPK@bobwxc.mipc> (raw)
In-Reply-To: <2c85bf903171b61d69aea0345913c89a740f1a86.1652713779.git.siyanteng@loongson.cn>

On Mon, May 16, 2022 at 11:56:31PM +0800, Yanteng Si wrote:
> Translate .../vm/page_migration.rst into Chinese.
> 
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  Documentation/translations/zh_CN/vm/index.rst |   2 +-
>  .../translations/zh_CN/vm/page_migration.rst  | 228 ++++++++++++++++++
>  2 files changed, 229 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/translations/zh_CN/vm/page_migration.rst
> 
> diff --git a/Documentation/translations/zh_CN/vm/index.rst b/Documentation/translations/zh_CN/vm/index.rst
> index a1c6d529b6ff..551f58bf7b55 100644
> --- a/Documentation/translations/zh_CN/vm/index.rst
> +++ b/Documentation/translations/zh_CN/vm/index.rst
> @@ -36,6 +36,7 @@ TODO:待引用文档集被翻译完毕后请及时修改此处)
>     numa
>     overcommit-accounting
>     page_frags
> +   page_migration
>     page_owner
>     page_table_check
>     remap_file_pages
> @@ -47,7 +48,6 @@ TODOLIST:
>  * arch_pgtable_helpers
>  * free_page_reporting
>  * hugetlbfs_reserv
> -* page_migration
>  * slub
>  * transhuge
>  * unevictable-lru
> diff --git a/Documentation/translations/zh_CN/vm/page_migration.rst b/Documentation/translations/zh_CN/vm/page_migration.rst
> new file mode 100644
> index 000000000000..417861fbc3e0
> --- /dev/null
> +++ b/Documentation/translations/zh_CN/vm/page_migration.rst
[...]
> +
> +非LRU页面迁移
> +=============
> +
> +尽管迁移最初的目的是为了减少NUMA的内存访问延迟,但压缩也使用迁移来创建高阶页面。
> +
> +目前实现的问题是,它被设计为只迁移*LRU*页。然而,有一些潜在的非LRU页面可以在驱动中
> +被迁移,例如,zsmalloc,virtio-balloon页面。
> +
> +对于virtio-balloon页面,迁移代码路径的某些部分已经被钩住,并添加了virtio-balloon
> +的特定函数来拦截迁移逻辑。这对一个驱动来说太特殊了,所以其他想让自己的页面可移动的驱
> +动就必须在迁移路径中添加自己的特定钩子。
> +
> +为了克服这个问题,VM支持非LRU页面迁移,它为非LRU可移动页面提供了通用函数,而在迁移
> +路径中没有特定的驱动程序钩子。
> +
> +如果一个驱动程序想让它的页面可移动,它应该定义三个函数,这些函数是
> +struct address_space_operations的函数指针。
> +
> +1. ``bool (*isolate_page) (struct page *page, isolate_mode_t mode);``
> +
> +   VM对驱动的isolate_page()函数的期望是,如果驱动成功隔离了该页,则返回×true×。

*true*

> +   返回true后,VM会将该页标记为PG_isolated,这样多个CPU的并发隔离就会跳过该
> +   页进行隔离。如果驱动程序不能隔离该页,它应该返回*false*。
> +
> [...]
> +
> +   * PG_isolated
> +
> +     为了防止几个CPU同时进行隔离,VM在lock_page()下将隔离的页面标记为PG_isolated。
> +     因此,如果一个CPU遇到PG_isolated非LRU可移动页面,它可以跳过它。驱动程序不需要
> +     操作这个标志,因为VM会自动设置/清除它。请记住,如果驱动程序看到PG_isolated页,
> +     这意味着VM已经被虚拟机隔离,所以它不应该碰page.lru字段。PG_isolated标志与

Emmm, I mean 虚拟机 -> VM
Sorry for the miss leading, seemis only strict mono font could understand
it.

Please fix these two, and pick my review-by :)

Thanks,
	Wu

> +     PG_reclaim标志是同义的,所以驱动程序不应该为自己的目的使用PG_isolated。
> +
> [...]


  reply	other threads:[~2022-05-17  3:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 15:56 [PATCH v3 0/2] docs/zh_CN: add vm page_migration translation Yanteng Si
2022-05-16 15:56 ` [PATCH v3 1/2] " Yanteng Si
2022-05-17  3:24   ` Wu X.C. [this message]
2022-05-17  4:00     ` yanteng si
2022-05-16 15:56 ` [PATCH v3 2/2] docs/zh_CN: add vm vmalloced-kernel-stacks translation Yanteng Si
2022-05-17  3:27   ` Wu X.C.

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=YoMVgfGXMSyLdCPK@bobwxc.mipc \
    --to=bobwxc@email.cn \
    --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=siyanteng01@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.