(resending, please ignore if duplicated) Hi,
I propose a debugging function of localcount, localcount_debug_refcnt, which returns a total reference count of a specified localcount. A result of localcount_debug_refcnt isn't guaranteed to be accurate, however it's still useful for debugging purposes, for example debugging on ATF tests using rump kernels. Here is a patch: http://www.netbsd.org/~ozaki-r/localcount_debug_refcnt.diff I added the following assertion in localcount_release: KDASSERT(localcount_debug_refcnt(lc) >= 0); IIUC it's a proper constraint of localcount even if a result of localcount_debug_refcnt isn't accurate. Any comments or suggestions? Thanks, ozaki-r