title: Understanding KVM CPU scheduler algorithm
body: <p>I am trying to understand CPU scheduling algorithm in KVM, but I haven't found the appropriate documentation for it.  </p>
  
  <p>For example, in XEN, when more than 1 vCPU is assigned to a single physical CPU (i.e., overcommitting),  XEN's default Credit Scheduler decides the order at which vCPUs will get access to that single pCPU. Then there are a number of parameters that can adjust the default behaviour, i.e., you can change default scheduling quanta (from 30~ms), you can assign different weights to VMs giving more/less CPU time, set work-preserving mode etc. </p>
  
  <p>However, I am not clear about the degree of control that you get in KVM. This <a href="https://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/ch25s06.html" rel="nofollow">documentation</a> explains how to pin vCPUs to pCPUs (which works fine). But I would like to know which scheduling algorithm is used by KVM and do we have any way to tweak it? For example to give more priority (CPU time) to some VMs or adjust I/O vs computing intensive tasks?</p>
  
  <p>Thanks!</p>