svn commit: r357990 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Sun Feb 16 03:16:29 UTC 2020


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);
 
 	/*


More information about the svn-src-all mailing list