title: UNIX system call to unset the reference bit of a specific page in page table?
body: <p>I'm trying to count hits of a specific set of pages, by hacking the reference bits in the page table. Is there any system call or any other way to unset reference bits (in UNIX-like systems)? </p>
  
  <p>A page table is the data structure used by a virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses. (<a href="https://en.wikipedia.org/wiki/Page_table" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Page_table</a>)</p>
  
  <p>In unix-like systems there is a bit associated with each page table entry, called "reference" bit, which indicates if a page was accessed since the bit was unset. 
  The linux kernel <strong>unsets</strong> these reference bits periodically and checks a while after that to know what pages have been accessed, in order to detect "hot" pages. But this information is very coarse grain and low-precision since it doesn't say anything about the number of accesses and their time. </p>
  
  <p>I want to count accesses to specific pages during shorter epochs by unsetting reference bits then check if the pages have been accessed after a short time.</p>
  
  <p>Therefore, I was wondering if there is any system call or CPU interrupt which provides means to unset "reference bits". Otherwise, I need to dive deep into kernel to see what goes on down there. </p>