kernel - Properly account system time for contending tokens
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 20 Feb 2013 06:56:58 +0000 (22:56 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 20 Feb 2013 06:56:58 +0000 (22:56 -0800)
commite2b925335d50b652b228d64c07f94863aee95dab
tree6dd31c99d9ce4dc2e96e1716045aab507d2a1f5b
parenta9844950530ae16eb3e75a9be633f52643914f58
kernel - Properly account system time for contending tokens

* When the LWKT schedule gets stuck on a contending token it switches
  through the idle thread, the idle thread is told not to halt, and
  resolution of the contention is handled by lwkt_switch() from the
  idle thread's context.

* This was causing token contention to be improperly accounted for as
  idle time in the per-cpu stats.  Fix the case by testing the
  RQF_AST_LWKT_RESCHED flag which tells the idle thread not to halt,
  and account for the tick as system time if the flag is set.

* The improper time accounting was causing powerd to come to the wrong
  conclusion in massively parralel fsstress tests on monster.dragonflybsd.org
  (48 cpus).  With the fix, powerd no longer becomes confused.

Reported-by: vsrinivas
sys/kern/kern_clock.c