Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 2019 16:40:16 +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: r355226 - head/sys/sys
Message-ID:  <201911301640.xAUGeG6C024992@repo.freebsd.org>

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

Log:
  vfs: swap placement between v_type and v_tag
  
  The former is frequently accessed (e.g., in vfs_cache_lookup) and shares the
  cacheline with v_usecount, avoidably adding to cache misses during concurrent
  lookup. The latter is almost unused and probably can get garbage-collected.
  
  The struct does not change in size despite enum vs char * discrepancy.
  On 64-bit archs there used to be 4 bytes padding after v_type giving 480 bytes
  in total.

Modified:
  head/sys/sys/vnode.h

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Sat Nov 30 14:17:45 2019	(r355225)
+++ head/sys/sys/vnode.h	Sat Nov 30 16:40:16 2019	(r355226)
@@ -103,7 +103,7 @@ struct vnode {
 	 * Fields which define the identity of the vnode.  These fields are
 	 * owned by the filesystem (XXX: and vgone() ?)
 	 */
-	const char *v_tag;			/* u type of underlying data */
+	enum	vtype v_type;			/* u vnode type */
 	struct	vop_vector *v_op;		/* u vnode operations vector */
 	void	*v_data;			/* u private data for fs */
 
@@ -173,7 +173,7 @@ struct vnode {
 	int	v_writecount;			/* I ref count of writers or
 						   (negative) text users */
 	u_int	v_hash;
-	enum	vtype v_type;			/* u vnode type */
+	const char *v_tag;			/* u type of underlying data */
 };
 
 #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */



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