title: implementation of dirty_expire_centisecs
body: <p>I'm trying to understand the behavior of dirty_expire_centisecs parameter on servers with 2.6 and 3.0 kernels. </p>
  
  <p>Kernel documentation says (vm.txt/dirty_expire_centisecs)
  "Data which has been dirty in-memory for longer than this interval will be written out next time a flusher thread wakes up."</p>
  
  <p>which implies, dirty data that has been in memory for shorter than this interval will not be written.</p>
  
  <p>According to my testing, behavior of dirty_expire_centisecs is as follows: when writeback timer fires before the expire timer, then no pages will be flushed, else all pages will be flushed. 
  If background_bytes limit reaches, it flushes all or portion depending on the rate, independent of both timers.</p>
  
  <p>My testing tells me at low write rates (less than 1MB per sec), dirty_background_bytes trigger will flush all dirty pages and at slightly higher data rates (higher than 2MB per sec), it flushes only a portion of the dirty data, independent of expiry value.</p>
  
  <p>This is different from what is said in the vm.txt. It make sense not to flush the most recent data. To me, observed behavior is not logical and practically useless. What do you guys think ?</p>
  
  <p>My test setup:
  Server with 16GB of RAM running Suse 11 SP1, SP2 and RedHat 6.2 (multi boot setup)</p>
  
  <pre><code>vm.dirty_bytes = 50000000            // 50MB &lt;br&gt;
  vm.dirty_background_bytes = 30000000 // 30MB &lt;br&gt;
  vm.dirty_writeback_centisecs = 1000  // 10 seconds &lt;br&gt;
  vm.dirty_expire_centisecs = 1500     // 15 seconds &lt;br&gt;
  </code></pre>
  
  <p>with a file writing tool where I can control the write()'s per sec rate and size.</p>