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 ...)

Ryota Ozaki <> 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:
> 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.

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.

Attachment: pgpqQ3V5RHlvp.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index