tech-kern archive

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

Re: passive references



Hi,

On 2016/02/10 1:07, Taylor R Campbell wrote:
>    Date: Tue, 9 Feb 2016 20:33:51 +0900
>    From: Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>
> 
>    Is "target->prt_draining = false;" required at the end of psref_target_drain()?
>    Or, shouldn't psref_target_drain() be called twice?
>    My kernel paniced with the following message.
>    ====================
>    kernel diagnostic assertion "!target->prt_draining" failed: file "sys/kern/subr_psref.c", line 395
>    ====================
> 
> You shouldn't call psref_target_drain twice, unless you have already
> called psref_target_destroy and psref_target_init again.  You should:
> 
> 1. Guarantee that no new references can be made.  For example, remove
> the object in question from a list.
> 
> 2. Call psref_target_drain (once) to wait for existing references to
> drain.
> 
> 3. Call psref_target_destroy to destroy the psref target.

Thank you for your kind answer.

I tried to use passive reference for a encaptab list itself instead of
pserialize_read_enter().
# As you know, packet processing path encap4_lookup() can sleep at
# ep->func.

I try to reuse psref for the encaptab list itself, however that must not
be a normal usage, I see.


> See the updated example I gave here for illustration:
> <https://mail-index.netbsd.org/tech-kern/2016/02/09/msg020184.html>.

I have not read the mail only a little. I read it closer.


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Product Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>


Home | Main Index | Thread Index | Old Index