Re: [PATCH v3 1/2] docs/zh_CN: add vm page_migration translation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wu X.C. <bobwxc@xxxxxxxx> 于2022年5月17日周二 11:25写道:
>
> 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@xxxxxxxxxxx>
> > ---
> >  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*
OK!
>
> > +   返回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
OK!

Thanks,
Yanteng
> 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。
> > +
> > [...]
>




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux