kernel - Optimize struct uidinfo
* Refactor struct uidinfo. Use atomic ops for ui_posixlocks
and ui_proccnt. They were already being used for ui_openfiles
and ui_ref.
* Refactor ui_ref a bit to improve the drop code. Use a cute
trick for the transition. When we transition to 0 we allow
ui_ref to actually go to 0, and then do an independent lookup
of the uid with the hash table spinlock to conditionally free
it if it remains 0.
This allows us to completely avoid using atomic_cmpset_int(),
which can be seriously inefficient due to races in SMP
environments.
Suggested-by: mjg__