From owner-svn-src-all@freebsd.org Sat Nov 30 16:40:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04CCA1B03A3; Sat, 30 Nov 2019 16:40:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QHDJ6M2pz4D18; Sat, 30 Nov 2019 16:40:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD7C31160; Sat, 30 Nov 2019 16:40:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUGeGfd024993; Sat, 30 Nov 2019 16:40:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUGeG6C024992; Sat, 30 Nov 2019 16:40:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201911301640.xAUGeG6C024992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 30 Nov 2019 16:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355226 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 16:40:17 -0000 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) */