Linux Scheduler Statistics
/proc/schedstat format
/proc/schedstat format version 2


This version contains fields that will be zero unless certain patches and config options have been utilized. These are noted below. CONFIG_NUMA will not be available as a config option except in the -mjb trees, which, from 2.5.62 forward, already have this schedstat patch incorporated. -mjb trees can be obtained at http:/www.aracnet.com/~fletch/linux.

Format for version 2 of schedstat:

tag 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
tag is cpuN or totals.

NOTE: In the sched_yield() statistics, the active queue is considered empty if it has only one process in it, since obviously the process calling sched_yield() is that process.

First four are sched_yield() statistics:

  1. # of times both the active and the expired queue were empty
  2. # of times just the active queue was empty
  3. # of times just the expired queue was empty
  4. # of times sched_yield() was called

Next three are schedule() statistics:

  1. # of times the active queue had at least one other process on it.
  2. # of times we switched to the expired queue and reused it
  3. # of times schedule() was called

Next seven are statistics dealing with load_balance() (requires CONFIG_SMP):

  1. # of times load_balance() was called at an idle tick
  2. # of times load_balance() was called at a busy tick
  3. # of times load_balance() was called from schedule()
  4. # of times load_balance() was called
  5. sum of imbalances discovered (if any) with each call to load_balance()
  6. # of times load_balance() was called when we did not find a "busiest" queue
  7. # of times load_balance() was called from balance_node() (requires CONFIG_NUMA)

Next four are statistics dealing with pull_task() (requires CONFIG_SMP):

  1. # of times pull_task() moved a task to this cpu
  2. # of times pull_task() stole a task from this cpu
  3. # of times pull_task() moved a task to this cpu from another node (requires CONFIG_NUMA and 2.5.65 or later)
  4. # of times pull_task() stole a task from this cpu for another node (requires CONFIG_NUMA and 2.5.65 or later)

Last two are statistics dealing with balance_node() (requires CONFIG_SMP and CONFIG_NUMA):

  1. # of times balance_node() was called
  2. # of times balance_node() was called at an idle tick


Questions to ricklind@us.ibm.com