可以的MMAP页面的污秽从用户空间发现了什么? [英] Can the dirtiness of pages of a mmap be found from userspace?

查看:168
本文介绍了可以的MMAP页面的污秽从用户空间发现了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否肮脏的(非共享)MMAP页面从用户空间linux下访问2.6.30+?特定于平台的黑客和组装机的欢迎。

Can dirtiness of pages of a (non-shared) mmap be accessed from userspace under linux 2.6.30+? Platform-specific hacks and kludges welcome.

在理想情况下,我在寻找的mmap'ed地区,这是如果该页面已被写入,因为该地区被mmap'ed设置的一组位,每页一个(4KB?)。

Ideally, I'm looking for an array of bits, one per page (4kB?) of the mmap'ed region, which are set if that page has been written to since the region was mmap'ed.

(我知道,这个过程做写作可以跟踪这些信息 - 但似乎这样做很傻,如果内核反正这样做)

(I am aware, that the process doing the writing could keep track of this information - but it seems silly to do so if the kernel is doing it anyway.)

谢谢,

克里斯。

推荐答案

见的/ proc / * /页映射的的的/ proc / kpageflags接口。
首先告诉你PFN一个地址,第二个会告诉你给PFN脏位。

See /proc/*/pagemap and /proc/kpageflags interfaces. First tells you PFN for an address, second tells you dirty bit given PFN.

请参阅FS的/ proc / task_mmu.c,文档/ VM / pagemap.txt,文档/ VM /页types.c。

See fs/proc/task_mmu.c , Documentation/vm/pagemap.txt, Documentation/vm/page-types.c .

这篇关于可以的MMAP页面的污秽从用户空间发现了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆