git: kernel - Properly account system time for contending tokens

Matthew Dillon dillon at
Tue Feb 19 22:59:42 PST 2013

commit e2b925335d50b652b228d64c07f94863aee95dab
Author: Matthew Dillon <dillon at>
Date:   Tue Feb 19 22:56:58 2013 -0800

    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
      (48 cpus).  With the fix, powerd no longer becomes confused.
    Reported-by: vsrinivas

Summary of changes:
 sys/kern/kern_clock.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

DragonFly BSD source repository

More information about the Commits mailing list