aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-07-02 12:58:07 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-07-02 12:58:07 +0000
commita2de789ebb804374bac13ef2931158c364c2774a (patch)
tree5cc3dc7272c98609513911869cfe52bc08a19acd /sys/kern
parentd23850207ba79556065a8d9429c5d8a60ca25931 (diff)
downloadsrc-a2de789ebb804374bac13ef2931158c364c2774a.tar.gz
src-a2de789ebb804374bac13ef2931158c364c2774a.zip
cred: add a prediction to crfree for td->td_realucred == cr
This matches crhold and eliminates an assembly maze in the common case.
Notes
Notes: svn path=/head/; revision=362890
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_prot.c2
1 files changed, 1 insertions, 1 deletions
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--;