kernel - Improve lockf performance
commitf62402828c638bc3d40d94bd1a4160fcc37db0a5
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 23 Apr 2018 07:19:46 +0000 (23 00:19 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 23 Apr 2018 07:19:46 +0000 (23 00:19 -0700)
tree46d3f5ce2ca5c802be1895b147f4229f95400ce4
parentf56151fa43e3b9a933b2c10ac2bbab0421823e12
kernel - Improve lockf performance

* Improve fcntl lockf performance with two small optimizations.
  Together these add a little over 10% in non-contended
  performance.

* Add a 2-entry-per-cpu range lock allocation cache.  This
  covers the most typical lock/unlock situations.

* Conditionalize the setting of VMAYHAVELOCKS to avoid unnecessary
  atomic ops.

* Remove the clearing of VMAYHAVELOCKS.  The cost in close() is
  basically nothing while the cost in the lockf critical path
  is several branches and an atomic op.
sys/kern/kern_lockf.c