title: How linux process scheduler prevents starvation of a process
body: <p>I have read that linux kernel contains many schedule classes each having it's own priority. To select a new process to run, the process scheduler iterates from the highest priority class to lowest priority class. If a runnable process is found in a class, the highest priority process is selected to run from that class.</p>
  
  <p>Extract from Linux kernel development by Robert Love:</p>
  
  <blockquote>
    <p>The main entry point into the process schedule is the function
    schedule() , defined in kernel/sched.c .This is the function that the
    rest of the kernel uses to invoke the process scheduler, deciding
    which process to run and then running it. schedule() is generic with
    respect to scheduler classes.That is, it finds the highest priority
    scheduler class with a runnable process and asks it what to run next.
    Given that, it should be no surprise that schedule() is simple.The
    only important part of the function—which is otherwise too
    uninteresting to reproduce here—is its invocation of pick_next_task()
    , also defined in kernel/sched.c .The pick_next_task() function goes
    through each scheduler class, starting with the highest priority, and
    selects the highest priority process in the highest priority class.</p>
  </blockquote>
  
  <p>Let's imagine the following scenario. There are some processes waiting in lower priority classes and processes are being added to higher priority classes continuously. Won't the processes in lower priority classes starve?</p>