cred: add a prediction to crfree for td->td_realucred == cr

This matches crhold and eliminates an assembly maze in the common case.
This commit is contained in:
mjg 2020-07-02 12:58:07 +00:00
parent 1e1fa4c881
commit 802c8851a5

View File

@ -1985,7 +1985,7 @@ crfree(struct ucred *cr)
struct thread *td; struct thread *td;
td = curthread; td = curthread;
if (td->td_realucred == cr) { if (__predict_true(td->td_realucred == cr)) {
KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p", KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p",
__func__, cr->cr_users, cr)); __func__, cr->cr_users, cr));
td->td_ucredref--; td->td_ucredref--;