title: Catching when the linux kernel writes a page back to a memory mapped file?
body: <p>I'm contemplating a system that would let me memory map files and transparently do type conversion on the data they contain.  It seems it's possible to catch memory accesses by mmaping a second memory region and making it protected, then catching the segfault when a new page is accessed.  This would let me handle the on-read type conversion I need.</p>
  
  <p>However, to be read/write compatible, I'd need some way to catch when the OS is paging part of the memory back to disk so I could do the type conversion the other way before it's written. </p>
  
  <p>Is there any capability for hooking the paging system in this way?</p>