An #ifdef that Taylor added in the new DRM code was bugging me,
because a similar situation already existed in the NetBSD kernel,
whereby the type stability of a object's backing memory (the iam
existentium case being LWPs) was required for a passively-serialized
weak reference to work. The LWP pool cache had a hack to handle it,
and the hack was propagated to the new DRM code under an #ifdef
__NetBSD__.
I initially fixed this by adding a pre-destruct callback that could be
optionally set for a pool cache, but after further discussion, it
seemed like having direct knowledge of passive serialization
synchronization points in the allocator was a better solution, so here
is a diff that implements it for you review.
https://www.netbsd.org/~thorpej/pool-pser-diff.txt
Please comment ASAP, because I want to ride a kernel version bump.