Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2019 16:41:48 +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: r355227 - head/sys/fs/tmpfs
Message-ID:  <201911301641.xAUGfmMt029299@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Sat Nov 30 16:41:47 2019
New Revision: 355227
URL: https://svnweb.freebsd.org/changeset/base/355227

Log:
  tmpfs: add fast path to tmpfs_access for common case lookup
  
  VEXEC consists of vast majority of all calls and almost all targets have
  at least 0111.

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c	Sat Nov 30 16:40:16 2019	(r355226)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c	Sat Nov 30 16:41:47 2019	(r355227)
@@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v)
 
 	node = VP_TO_TMPFS_NODE(vp);
 
+	/*
+	 * Common case path lookup.
+	 */
+	if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111))
+		return (0);
+
 	switch (vp->v_type) {
 	case VDIR:
 		/* FALLTHROUGH */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911301641.xAUGfmMt029299>