tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Debugging function of localcount



On Wed, Jul 26, 2017 at 1:34 PM, Ryota Ozaki <ozaki-r%netbsd.org@localhost> wrote:
> (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?

Oops. I thought we could use percpu_foreach in softint, but
I was wrong. So localcount_debug_refcnt can be used only
in thread contexts. And the above assertion shouldn't be
there. The proposal isn't so much worthwhile ;-<

  ozaki-r


Home | Main Index | Thread Index | Old Index