git: kernel - Fix degenerate condition in dfly_setrunqueue_locked()

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Jan 12 22:29:08 PST 2016


commit f95769d250511419731d255c79b3be89a878753d
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Jan 12 22:19:25 2016 -0800

    kernel - Fix degenerate condition in dfly_setrunqueue_locked()
    
    * dfly_setrunqueue_locked() was unconditionally adding the lp to the end
      of the round-robin queue for the specified priority due to a degenerate
      '... || !TAILQ_EMPTY()' test.
    
      Remove the degenerate test, allowing a thread to be entered onto the
      head of the queue if its rrcount is reasonable.  Theoretically this should
      allow interactivity at the same queue priority even in a heavily-batched
      environment.
    
    * Do not reset rrcount when adding to the head of the queue even if
      the queue is otherwise empty.  This allows the round-robin state to be
      retained across short delays (for example, nanosleeps) which are not as
      interactive as the system might otherwise believe, resulting in a more fair
      apportionment of cpu between batchy threads that use different delays but
      wind up at the same priority.
    
    * Also adjust dfly_resetpriority() to reset lwp_rrcount to 0 when moving
      a thread to a higher priority queue.
    
    * These changes should probably be re-tested against the postgres test
      suite to determine if any regressions were introduced.  It could very
      well be that the original action of always adding to the end of the queue
      might actually be the best action to take.
    
    Reported-by: Adrian Drzewiecki <z at drze.net>

Summary of changes:
 sys/kern/usched_dfly.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f95769d250511419731d255c79b3be89a878753d


-- 
DragonFly BSD source repository



More information about the Commits mailing list