Date: Sun, 16 Feb 2020 03:16:29 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357990 - head/sys/kern Message-ID: <202002160316.01G3GTVX074905@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Feb 16 03:16:28 2020 New Revision: 357990 URL: https://svnweb.freebsd.org/changeset/base/357990 Log: vfs: check early for VCHR in vput_final to short-circuit in the common case Otherwise the compiler inlines v_decr_devcount which keps getting jumped over in the common case of not dealing with a device. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Feb 16 03:14:55 2020 (r357989) +++ head/sys/kern/vfs_subr.c Sun Feb 16 03:16:28 2020 (r357990) @@ -3208,7 +3208,7 @@ vput_final(struct vnode *vp, enum vput_op func) VNPASS(vp->v_holdcnt > 0, vp); VI_LOCK(vp); - if (func != VRELE) + if (__predict_false(vp->v_type == VCHR && func != VRELE)) v_decr_devcount(vp); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002160316.01G3GTVX074905>