git: kernel - Improve lockf performance

Matthew Dillon dillon at
Mon Apr 23 00:33:24 PDT 2018

commit f62402828c638bc3d40d94bd1a4160fcc37db0a5
Author: Matthew Dillon <dillon at>
Date:   Mon Apr 23 00:19:46 2018 -0700

    kernel - Improve lockf performance
    * Improve fcntl lockf performance with two small optimizations.
      Together these add a little over 10% in non-contended
    * 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.

Summary of changes:
 sys/kern/kern_lockf.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 53 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list