After this patch the set gets smaller. This is unfortunately quite broad. This is part of a set from https://github.com/freebsd/freebsd/compare/master...jwroberson:schedlock
The impetus is to do lockless tdq_add on remote cpus. That is not part of this patch or branch. Eliminating recursion also greatly reduces the number of atomics in critical scheduler paths. This adds two thread flags that could possibly use better names. I did not want to add HOLDTD but I could not see a way to implement priority lending cleanly without it. While the signal code would be simpler if I used it, it would make fewer cases where lockless add would be profitable and longer code chains with sched lock still held.
The sleepq_remove_thread and weed_inhib changes need the most attention. The rest is really boilerplate.