【发布时间】:2015-08-30 18:47:34
【问题描述】:
在页面结构中,有私有字段。 如果我使用 page_buffers() 函数,它们会返回该字段。
还有 PrivatePage()。 但我不知道它是什么。
这是什么?
【问题讨论】:
标签: linux memory linux-kernel kernel
在页面结构中,有私有字段。 如果我使用 page_buffers() 函数,它们会返回该字段。
还有 PrivatePage()。 但我不知道它是什么。
这是什么?
【问题讨论】:
标签: linux memory linux-kernel kernel
参见include/linux/page-flags.h:
* Private page markings that may be used by the filesystem that owns the page
* for its own purposes.
* - PG_private and PG_private_2 cause releasepage() and co to be invoked
还有文档/文件系统/vfs.txt:
地址空间处理程序可以将额外信息附加到页面, 通常使用“结构页面”中的“私有”字段。如果这样 附加信息时,应设置 PG_Private 标志。这会 导致各种 VM 例程对 address_space 进行额外调用 处理该数据的处理程序。
page_buffers() 用于private 字段包含指向struct buffer_head 的指针的特定情况,这是文件系统驱动程序中非常常见的模式。
【讨论】: