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:
Mateusz Guzik 2020-07-02 12:58:07 +00:00
parent d23850207b
commit a2de789ebb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362890

View File

@ -1985,7 +1985,7 @@ crfree(struct ucred *cr)
struct thread *td;
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",
__func__, cr->cr_users, cr));
td->td_ucredref--;