kernel - usched_dfly revamp (6), reimplement shared spinlocks & misc others
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Sep 2012 01:24:22 +0000 (18:24 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Sep 2012 01:24:22 +0000 (18:24 -0700)
commit0846e4ceea46414947a7162124a713ecf1cab19b
tree44c5a09a5740d3411a72074e415ecd16be931ff2
parent433c75c34a02757b400e474eab030c6e56f3e8a3
kernel - usched_dfly revamp (6), reimplement shared spinlocks & misc others

* Rename gd_spinlocks_wr to just gd_spinlocks.

* Reimplement shared spinlocks and optimize the shared spinlock path.
  Contended exclusive spinlocks are less optimal with this change.

* Use shared spinlocks for all file descriptor accesses.  This includes
  not only most IO calls like read() and write(), but also callbacks
  from kqueue to double-check the validity of a file descriptor.

* Use getnanouptime() instead of nanouptime() in kqueue_sleep() and
  kern_kevent(), removing a hardware I/O serialization (to read the HPET)
  from the critical path.

* These changes significantly reduce kernel spinlock contention when running
  postgres/pgbench benchmarks.
16 files changed:
sys/kern/kern_descrip.c
sys/kern/kern_event.c
sys/kern/kern_intr.c
sys/kern/kern_lock.c
sys/kern/kern_mutex.c
sys/kern/kern_spinlock.c
sys/kern/lwkt_ipiq.c
sys/kern/lwkt_thread.c
sys/kern/usched_bsd4.c
sys/kern/usched_dfly.c
sys/platform/pc32/isa/clock.c
sys/platform/pc64/isa/clock.c
sys/sys/globaldata.h
sys/sys/mutex2.h
sys/sys/spinlock.h
sys/sys/spinlock2.h