MCPcopy Create free account
hub / github.com/F-Stack/f-stack / blockcount_release

Function blockcount_release

freebsd/sys/blockcount.h:67–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67static __inline void
68blockcount_release(blockcount_t *bc, u_int n)
69{
70 u_int old;
71
72 atomic_thread_fence_rel();
73 old = atomic_fetchadd_int(&bc->__count, -n);
74 KASSERT(old >= n, ("%s: counter underflow %p", __func__, bc));
75 if (_BLOCKCOUNT_COUNT(old) == n && _BLOCKCOUNT_WAITERS(old))
76 _blockcount_wakeup(bc, old);
77}
78
79static __inline void
80_blockcount_wait(blockcount_t *bc, struct lock_object *lo, const char *wmesg,

Callers 3

vm_object_pip_wakeupnFunction · 0.85
vm_object_unbusyFunction · 0.85
vm_pageout_helperFunction · 0.85

Calls 3

_blockcount_wakeupFunction · 0.85
atomic_thread_fence_relFunction · 0.50
atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected