[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Tracking actual memory utilization

Tracking actual memory utilization

Posted May 1, 2015 11:23 UTC (Fri) by etienne (guest, #25256)
Parent article: Tracking actual memory utilization

> That action will make the page inaccessible (much like the normal kernel usage tracking does) so that a fault will result whenever a process tries to read or write that page

I believe Intel/AMD processor have an "accessed" bit for each page so that you would not need to make the page inaccessible (and save the exception CPU time to swap it back to accessible, all being done in hardware).
I believe ARM do not have that "accessed" bit.


to post comments

Tracking actual memory utilization

Posted May 2, 2015 8:40 UTC (Sat) by jzbiciak (guest, #5246) [Link]

I can confirm that ARM (at least as of v7, using LPAE) has an Accessed Flag (AF) in the page table entry. (I've only ever worked directly with LPAE; I've avoided the horror show that is ARM's 32-bit page table format.) When LPAE is enabled, you can set the MMU to automatically manage the AF, or to fault on access to a page that has AF=0 so that software can set the flag and do whatever other bookkeeping it desires.

When you configure the ARM hardware to automatically set AF, then this all happens silently in the background. If you configure the ARM hardware to fault when AF=0, then clearing AF is effectively removes access to the page. You take a page fault on accessing it.

I haven't gotten into the guts of how Linux uses flags such as these when the hardware offers them. For example, when LPAE is in use, does ARM Linux configure the MMU to manage AF in hardware or software?


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds