From a2de789ebb804374bac13ef2931158c364c2774a Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Thu, 2 Jul 2020 12:58:07 +0000 Subject: [PATCH] cred: add a prediction to crfree for td->td_realucred == cr This matches crhold and eliminates an assembly maze in the common case. --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 8057749c0ce6..3dbf3e19acbe 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -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--;