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) */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to