kernel - Handle spinlock indefinite wait edge case
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 18 Apr 2018 18:38:30 +0000 (11:38 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 19 Apr 2018 04:14:14 +0000 (21:14 -0700)
commit97cfa33012a9985f27056b9b9fe3c2040ca4bb67
tree494b2271cedd7506a01bbc8c6590a59b76f3e70c
parenta50a868984b0bb4faac0ed6db01bbc46effefb33
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.
sys/kern/kern_spinlock.c