diff options
| author | ShengYi Hung <aokblast@FreeBSD.org> | 2026-10-21 07:03:27 +0000 |
|---|---|---|
| committer | ShengYi Hung <aokblast@FreeBSD.org> | 2026-11-04 23:41:05 +0000 |
| commit | 7806832f23fb31d28386d42692b221776c9f4ee4 (patch) | |
| tree | e253e296102396b0f557d3b92e24d4c4f4aee0ce /bin/ed/test/d.d | |
| parent | 9d48e88e023634e12530bf9db4a2e85d022b93db (diff) | |
For a pshare key, we can actually cache the last one as a fast path
instead of trapping into kernel directly. It makes sense as a lock and
unlock should be a pair on the same key and at the same time. For
example, lock(A) -> unlock(A) -> lock(B) -> unlock(B). Each unlock is
a hit and refresh later (50% hit).
For a single pshare lock, it is evne a 100% hit as the key never
changed.
For nested lock lock(A) -> lock(B) -> lock(C) -> unlock(C) ->
unlock(B) -> unlock(A). It only cache the last one. However, we should
really think about rewritting this logic as it is a pshare lock shared
by many processes and nested should be uncommon.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60957
Diffstat (limited to 'bin/ed/test/d.d')
0 files changed, 0 insertions, 0 deletions
