Date: Mon, 30 Oct 2017 09:38:49 -0700 From: Matt Joras <mjoras@FreeBSD.org> To: Ian Lepore <ian@freebsd.org>, Hans Petter Selasky <hps@selasky.org>, "freebsd-arch@FreeBSD.org" <freebsd-arch@FreeBSD.org> Subject: Re: Allow faster eventhandler dispatching by keeping pointers to handler lists. Message-ID: <54876119-9262-c15b-d3fe-1220cf7f17f6@FreeBSD.org> In-Reply-To: <1509379503.21609.103.camel@freebsd.org> References: <1509243567.56824.103.camel@freebsd.org> <3a71dd31-99cb-c891-9d52-a7f2e7010011@FreeBSD.org> <1509293552.21609.5.camel@freebsd.org> <1509294247.21609.12.camel@freebsd.org> <7b59ff3d-3458-0bca-e6b4-13454b13efb0@FreeBSD.org> <1509296624.21609.24.camel@freebsd.org> <0fad1391-726d-8215-075d-9411abdf6edb@selasky.org> <1509379503.21609.103.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/30/2017 09:05, Ian Lepore wrote: > 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 Agreed. There are all sorts of clever things we can do with a more comprehensive rewrite. It would be a nice place to try out RCU-ish methods of handling object removal without locks. Matt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54876119-9262-c15b-d3fe-1220cf7f17f6>