title: Referenced and Modified bit in TLB and PTE
body: <p>You might know these as Accessed and Dirty bits. Now x86 <a href="http://wiki.osdev.org/File%3aPage_table.png" rel="nofollow">PTE</a> contains these bits. Lets say the TLB also contains these bits. In case of a TLB hit, these bits will be set by the hardware if the page frame they are referring to is accessed or modified. My question is when are these bits copied back to the PTE by the hardware and how exactly is this accomplished (especially in case of software managed TLB)? </p>
  
  <p>PS - I wish to know this because I am trying to design and test a page replacement algorithm.</p>