tech-kern archive

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

Re: Debugging function of localcount



On Wed, Nov 15, 2017 at 3:13 AM, Taylor R Campbell
<campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
>> Date: Mon, 13 Nov 2017 13:59:32 +0900
>> From: Ryota Ozaki <ozaki-r%netbsd.org@localhost>
>>
>> I'm sorry for not replying this thread. I'm back.
>>
>> I've revised the patch as your suggestions:
>>   http://www.netbsd.org/~ozaki-r/localcount_debug_atomic.revised.diff
>
> Looks better, thanks!
>
> Couple nits:
>
> 1. Still need to volatile-qualify lc_refcnt.
> 2. Either use unsigned and atomic_cas_uint, or uint32_t and
>    atomic_cas_32, but not a mixture.

Thanks, revised:
    http://www.netbsd.org/~ozaki-r/localcount_debug_atomic.revised2.diff

>
> Random thought: What about a per-LWP counter for diagnostics, with
> lwp_getspecific/setspecific?  No interprocessor overhead that way.
> Could even assert when an lwp exits, or when a softint returns, that
> no localcounts were leaked.
>
> (This slightly changes the semantics of localcount so that it cannot
> be passed from lwp to lwp (i.e., can't acquire in one and release in
> the other; must acquire in both and release in both), but I don't
> really see a problem with that.)

NACK because current uses of localcount on IPsec depend on that lwp
migrations are permitted; a reference of localcount last over opencrypto
processing that may use hardware offloading and resume its processing
in a dedicated softint.

Thanks,
  ozaki-r


Home | Main Index | Thread Index | Old Index