tech-net archive

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

MP-safe DAD timer destruction with callout_stop


For a certain reason(*), DAD timers are hard to use
callout_halt to destroy DAD timer objects. So I was going
to fall back to callout_stop (as of NetBSD 7) that is
almost safe but still has a possibility of going wrong(**).

(*) See the thread starting at

Discussing with @riastradh, we found a possible way to
make DAD timer destructions MP-safe with callout_stop.
This is a PoC patch:

The issue of using callout_stop instead of callout_halt is
that callout_stop doesn't actually stop the running callout.
So we cannot safety free a related data after calling

The new approach copes with the issue by delegating the
destruction of a callout to callout itself, which allows us
to not wait the callout to finish. This can be done thanks
to that DAD objects are separated from other data such as

Any comments or suggestions?


Home | Main Index | Thread Index | Old Index