git: kernel - Handle spinlock indefinite wait edge case

Matthew Dillon dillon at
Wed Apr 18 21:14:17 PDT 2018

commit 97cfa33012a9985f27056b9b9fe3c2040ca4bb67
Author: Matthew Dillon <dillon at>
Date:   Wed Apr 18 11:38:30 2018 -0700

    kernel - Handle spinlock indefinite wait edge case
    * The spinlock exclusive priority mechanism can cause an indefinite
      wait situation for shared locks to arise when a large number of cpu
      cores are cycling the same spinlock both shared and exclusive.
      This situation just won't happen for any real workload, but it
      can come up in benchmarks.
    * Introduce a quick hack to ensure that this situation does not lead
      to a panic.  The exclusive priority mechanism is ignored once a
      shared spinlock has spun for greater than one second.

Summary of changes:
 sys/kern/kern_spinlock.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list