tech-net archive

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

Re: Making bpf MPSAFE (was Re: struct ifnet and ifaddr handling ...)



On Thu, Aug 7, 2014 at 7:57 PM, Greg Troxel <gdt%ir.bbn.com@localhost> wrote:
>
> Ryota Ozaki <ozaki-r%netbsd.org@localhost> writes:
>
>> BTW, I worry about there is no easy way to
>> know if a function in a critical section
>> blocks/sleeps or not. So I wrote a patch to
>> detect that: http://www.netbsd.org/~ozaki-r/debug-pserialize.diff
>> Is it meaningful?
>
> It seems sensible, but it is very much undercommented.  Somewhere, the
> point of the variable, what it means, and why the test is right should
> be explained.

Agreed. I'll write some notes.

>
> I think the point is that sleep should not be called while pserialize is
> active.  And probably preemption shouldn't happen either, so we won't
> get false hits from other threads sleeping.
>
> I realize it's typical to reject adding such comments on the theory that
> everyone should already understand all of this.  But the complexity of
> our locking (and memory allocation) is high, and I think it helps
> correctness to be much more explicit about the plan.

Yes, I think we need some manual equivalent to locking(9) of FreeBSD.

  ozaki-r


Home | Main Index | Thread Index | Old Index