]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a blocking counter KPI.
authormarkj <markj@FreeBSD.org>
Fri, 28 Feb 2020 16:05:18 +0000 (16:05 +0000)
committermarkj <markj@FreeBSD.org>
Fri, 28 Feb 2020 16:05:18 +0000 (16:05 +0000)
commitf1a13462c4bedadd26dfba799c4c4df903b5ab9e
treea7e90d5c78ec00f8619edaaeabf706ab037b1c9c
parent8128edee48de4ebd53034a567155a45d8650bbc6
Add a blocking counter KPI.

refcount(9) was recently extended to support waiting on a refcount to
drop to zero, as this was needed for a lockless VM object
paging-in-progress counter.  However, this adds overhead to all uses of
refcount(9) and doesn't really match traditional refcounting semantics:
once a counter has dropped to zero, the protected object may be freed at
any point and it is not safe to dereference the counter.

This change removes that extension and instead adds a new set of KPIs,
blockcount_*, for use by VM object PIP and busy.

Reviewed by: jeff, kib, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23723
sys/kern/kern_synch.c
sys/kern/vfs_bio.c
sys/sys/_blockcount.h [new file with mode: 0644]
sys/sys/blockcount.h [new file with mode: 0644]
sys/sys/refcount.h
sys/vm/vm_fault.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_pager.h
sys/vm/vm_swapout.c