diff options
author | mjg <mjg@FreeBSD.org> | 2017-03-16 06:14:33 +0000 |
---|---|---|
committer | mjg <mjg@FreeBSD.org> | 2017-03-16 06:14:33 +0000 |
commit | 1e66e0ccb32ef8ad37a0168f93ee44a2d710cff4 (patch) | |
tree | 00318f3630e83c84f23c74e76b20908ecc3f117a /sys/sys | |
parent | 506e75ae888343fb09fb5046460590f90ec41a3f (diff) | |
download | FreeBSD-src-1e66e0ccb32ef8ad37a0168f93ee44a2d710cff4.zip FreeBSD-src-1e66e0ccb32ef8ad37a0168f93ee44a2d710cff4.tar.gz |
MFC r313683:
lockmgr: implement fast path
The main lockmgr routine takes 8 arguments which makes it impossible to
tail-call it by the intermediate vop_stdlock/unlock routines.
The routine itself starts with an if-forest and reads from the lock itself
several times.
This slows things down both single- and multi-threaded. With the patch
single-threaded fstats go 4% up and multithreaded up to ~27%.
Note that there is still a lot of room for improvement.
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/lockmgr.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/lockmgr.h b/sys/sys/lockmgr.h index a74d5f5..d36d6c8 100644 --- a/sys/sys/lockmgr.h +++ b/sys/sys/lockmgr.h @@ -68,6 +68,10 @@ struct thread; */ int __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, const char *wmesg, int prio, int timo, const char *file, int line); +int lockmgr_lock_fast_path(struct lock *lk, u_int flags, + struct lock_object *ilk, const char *file, int line); +int lockmgr_unlock_fast_path(struct lock *lk, u_int flags, + struct lock_object *ilk); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _lockmgr_assert(const struct lock *lk, int what, const char *file, int line); #endif |