Can the dirtiness of pages of a mmap be found from userspace?

前端 未结 5 517
感动是毒
感动是毒 2020-12-15 07:36

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

Ideally, I\'m looking for

5条回答
  •  不思量自难忘°
    2020-12-15 07:58

    This data would be continually out of date - it's possible the page may be written back after your process sees the page is dirty.

    That said, tone way is to map it in one-page chunks, then look at /proc/pid/smaps to see if the chunks are dirty - that said, this may fail if the kernel merges the pages.

    Unfortunately, since the page tables aren't visible to the user space process, that's about the best you can do without a kernel patch of some sort.

提交回复
热议问题