diff options
author | Mark Johnston <markj@FreeBSD.org> | 2020-02-28 16:05:18 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2020-02-28 16:05:18 +0000 |
commit | c99d0c5801ce22a9976e491d04ce7e1b8996dfdd (patch) | |
tree | a7e90d5c78ec00f8619edaaeabf706ab037b1c9c /sys/kern/vfs_bio.c | |
parent | f37cc7137dc832aec317f0ba0bccde9436b5d9fb (diff) | |
download | src-c99d0c5801ce22a9976e491d04ce7e1b8996dfdd.tar.gz src-c99d0c5801ce22a9976e491d04ce7e1b8996dfdd.zip |
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
Notes
Notes:
svn path=/head/; revision=358432
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 0d95776676c5..a4da72d208fe 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2854,9 +2854,9 @@ vfs_vmio_iodone(struct buf *bp) bool bogus; obj = bp->b_bufobj->bo_object; - KASSERT(REFCOUNT_COUNT(obj->paging_in_progress) >= bp->b_npages, + KASSERT(blockcount_read(&obj->paging_in_progress) >= bp->b_npages, ("vfs_vmio_iodone: paging in progress(%d) < b_npages(%d)", - REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages)); + blockcount_read(&obj->paging_in_progress), bp->b_npages)); vp = bp->b_vp; VNPASS(vp->v_holdcnt > 0, vp); |