Allow faster eventhandler dispatching by keeping pointers to handler lists.

Ian Lepore ian at freebsd.org
Mon Oct 30 16:05:11 UTC 2017


On Mon, 2017-10-30 at 09:17 +0100, Hans Petter Selasky wrote:
> On 10/29/17 18:03, Ian Lepore wrote:
> > 
> > Oh.  Right.  Hmmm, I think malloc() is required to support the case
> > where a handler registers before the static list init is invoked, and I
> > do think that's a useful feature to preserve.  That means the lists
> > aren't really static, though, which then makes STATIC a bit out of
> > place in the new function/macro names.
> Why not use RCU here, and then update sys/queue.h to be RCU safe?
> 
> --HPS

I'm not sure how that suggestion relates to that paragraph, but the
code already does use a form of RCU to handle deletion of registered
handlers from individual event lists.  It could probably benefit from a
rewrite to more fully embrace RCU and use it for insertions as well,
but that's beyond the scope of these changes, which are trying to
eliminate the worst uses of a global lock at a higher level than
maintaining the list for a single event.

-- Ian


More information about the freebsd-arch mailing list