Linux中映射到磁盘文件的脏页如何刷新到文件中?

发布于 2025-01-17 02:48:11 字数 221 浏览 5 评论 0原文

我正在尝试弄清楚 Linux IO 的内部结构。
在一个应用程序中,我将磁盘文件映射到用户空间虚拟地址,并将一些数据写入虚拟地址。我认为 Linux 中触发了页面错误来为映射的磁盘文件创建 PTE,并且 PTE 设置了“脏”位。过了一会儿,有些东西将脏页刷新到磁盘文件,从而通过 mmap 写入文件完成。
所以我的问题是 Linux 内核中的哪个组件检测到“脏”页面来执行页面刷新以及这种检测和刷新多久发生一次?

I am trying to figure out Linux IO internals.
In one application, I mmap a disk file to user space virtual address, the write some data to the virtual address. I think there triggered a page fault in Linux to create a PTE for the mapped disk file and the PTE has 'Dirty' bit set. After a while, something flushed the dirty page to disk file, thus writing to file through mmap is done.
So my question is what component in Linux kernel detects the 'Dirty' page to do the page flushing and how ofter does this detecting and flushing happen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文