The new code uses rm and rms locks respectively to fix scalability issues of the original API.
On top of atomic ops removal it is faster single-threaded by replacing linked lists in favor of an array of callbacks.
Lost features which should not matter:
- arbitrary argument to be stored at registration and passed to the callback -- all but one cases that I found pass NULL
- ability to reference lists which don't exist
- ability to have the callback unregister itself
The original API effectively allowed unbounded sleep as it was executing callbacks without any locks held, but this is not an option with the new approach of keeping locks held the entire time. Relocking would only add overhead. The preemptible case can be used while within NET_EPOCH and to my understanding netlink wants it.
In https://people.freebsd.org/~mjg/eventhandler/ there is a patchset where I converted every single user of EVENTHANDLER_DIRECT_INVOKE and finally retired that bit, with the intent of having any new handler points use the new API.
I tried converting all current users, but there is just too much, so I think the above is a fair compromise.
TODO: document the new API and denote the current one as deprecated ; ask someone with powerpc to test the patch to their code