title: CPU cache behaviour/policy for file-backed memory mappings?
body: <p>Does anyone know which type of CPU cache behaviour or policy (e.g. uncacheable write-combining)  is assigned to memory mapped <em>file-backed</em> regions on modern x86 systems?</p>
  
  <p>Is there any way to detect which is the case, and possibly override the default behaviour?</p>
  
  <p>Windows and Linux are the main operating systems of interest.</p>
  
  <p>(Editor's note: the question was previously phrased as <a href="https://en.wikipedia.org/wiki/Memory-mapped_I/O" rel="nofollow noreferrer">memory mapped I/O</a>, but that phrase has a different specific technical meaning, especially when talking about CPU caches.  i.e. actual I/O devices like NICs or video cards that you talk to with loads / stores.</p>
  
  <p>This question is actually about what kind of memory you get from <code>mmap(some_fd, ...)</code>, when you don't use MAP_ANONYMOUS and it's backed by a regular file on disk.)</p>