title: How NOHZ=ON affects do_timer() in Linux kernel?
body: <p>In a simple experiment I set <code>NOHZ=OFF</code> and used <code>printk()</code> to print how often the <code>do_timer()</code> function gets called. It gets called every 10 ms on my machine. </p>
  
  <p>However if <code>NOHZ=ON</code> then there is a lot of jitter in the way <code>do_timer()</code> gets called. Most of the times it does get called every 10 ms but there are times when it completely misses the deadlines. </p>
  
  <p>I have researched about both <code>do_timer()</code> and NOHZ. <code>do_timer()</code> is the function responsible for updating <code>jiffies</code> value and is also responsible for the round robin scheduling of the processes. </p>
  
  <p>NOHZ feature switches off the hi-res timers on the system. </p>
  
  <p>What I am unable to understand is how can hi-res timers affect the <code>do_timer()</code>? Even if hi-res hardware is in sleep state the persistent clock is more than capable to execute <code>do_timer()</code> every 10 ms. Secondly if <code>do_timer()</code> is not executing when it should, that means some processes are not getting their timeshare when they should ideally be getting it. A lot of googling does show that for many people many applications start working much better when <code>NOHZ=OFF</code>.</p>
  
  <p>To make long story short, how does <code>NOHZ=ON</code> affect <code>do_timer()</code>?<br>
  Why does <code>do_timer()</code> miss its deadlines?</p>