tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]
Date: Tue, 25 Nov 2014 00:42:58 +0900
From: Masao Uebayashi <uebayasi%gmail.com@localhost>
On Mon, Nov 24, 2014 at 11:16 PM, Taylor R Campbell
<campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
> Date: Mon, 24 Nov 2014 15:26:21 +0900
> From: Masao Uebayashi <uebayasi%gmail.com@localhost>
>
> I think pserialize_read_{enter,exit}() should explicitly call
> KPREEMPT_{DISABLE,ENABLE}(), as is done in percpu_{getref,putref}().
>
> Not necessary -- splsoftserial is sufficient to prevent switching, and
> is necessary to block the pserialize cross-call until the reader is
> finished.
I want stronger constraint than softint context. Softint prevents
threads from being preempted implicitly, but still allows to sleep. I
want pserialize(9)'ed readers to never sleep (critical section).
KPREEMPT_DISABLE() (and kpreempt_disable()) sets l_noprempt. Which
seems the official way to declare entering critical section.
Different kinds of critical section. Neither one actually prevents
sleep. It would be nice if pserialize_read and percpu communicated
with ASSERT_SLEEPABLE, but that's not the case right now.
Home |
Main Index |
Thread Index |
Old Index