From e7565a37f0c93e26b89593d5e6156dc73a235372 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 14 Jan 2013 05:46:49 +0000 Subject: Rearrange the struct bufobj and struct vnode layouts to reduce padding. On the amd64 kernel with INVARIANTS turned off, size of the struct vnode is reduced from 496 to 472 bytes, saving 24 bytes of memory and KVA per vnode. Noted and reviewed by: peter Tested by: pho Sponsored by: The FreeBSD Foundation --- sys/sys/bufobj.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/sys/bufobj.h') diff --git a/sys/sys/bufobj.h b/sys/sys/bufobj.h index 3934553..79bef84 100644 --- a/sys/sys/bufobj.h +++ b/sys/sys/bufobj.h @@ -89,12 +89,7 @@ struct buf_ops { struct bufobj { struct mtx bo_mtx; /* Mutex which protects "i" things */ - struct bufv bo_clean; /* i Clean buffers */ - struct bufv bo_dirty; /* i Dirty buffers */ - long bo_numoutput; /* i Writes in progress */ - u_int bo_flag; /* i Flags */ struct buf_ops *bo_ops; /* - Buffer operations */ - int bo_bsize; /* - Block size for i/o */ struct vm_object *bo_object; /* v Place to store VM object */ LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ void *bo_private; /* private pointer */ @@ -103,6 +98,11 @@ struct bufobj { * XXX: only to keep the syncer working * XXX: for now. */ + struct bufv bo_clean; /* i Clean buffers */ + struct bufv bo_dirty; /* i Dirty buffers */ + long bo_numoutput; /* i Writes in progress */ + u_int bo_flag; /* i Flags */ + int bo_bsize; /* - Block size for i/o */ }; /* -- cgit v1.1