[PATCH v2] xfs: reorder xfs_inode structure elements to remove unneeded padding.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



By reordering the elements in the xfs_inode structure, we can
reduce the padding needed on an x86_64 system by 8 bytes.

Furthermore, it also enables denser packing of xfs_inode
structures within slab pages. In the Debian 6.8.12-amd64,
before applying the patch, the size of xfs_inode is 1000 bytes,
allowing 32 xfs_inode structures to be allocated from an
order-3 slab. After applying the patch, the size of
xfs_inode is reduced to 992 bytes, allowing 33 xfs_inode
structures to be allocated from an order-3 slab.

This improvement is also observed in the mainline kernel
with the same config.

Signed-off-by: Junchao Sun <sunjunchao2870@xxxxxxxxx>
---
 fs/xfs/xfs_inode.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 292b90b5f2ac..fedac2792a38 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -37,12 +37,6 @@ typedef struct xfs_inode {
 	struct xfs_ifork	i_df;		/* data fork */
 	struct xfs_ifork	i_af;		/* attribute fork */
 
-	/* Transaction and locking information. */
-	struct xfs_inode_log_item *i_itemp;	/* logging information */
-	struct rw_semaphore	i_lock;		/* inode lock */
-	atomic_t		i_pincount;	/* inode pin count */
-	struct llist_node	i_gclist;	/* deferred inactivation list */
-
 	/*
 	 * Bitsets of inode metadata that have been checked and/or are sick.
 	 * Callers must hold i_flags_lock before accessing this field.
@@ -88,6 +82,12 @@ typedef struct xfs_inode {
 	/* VFS inode */
 	struct inode		i_vnode;	/* embedded VFS inode */
 
+	/* Transaction and locking information. */
+	struct xfs_inode_log_item *i_itemp;	/* logging information */
+	struct rw_semaphore	i_lock;		/* inode lock */
+	struct llist_node	i_gclist;	/* deferred inactivation list */
+	atomic_t		i_pincount;	/* inode pin count */
+
 	/* pending io completions */
 	spinlock_t		i_ioend_lock;
 	struct work_struct	i_ioend_work;
-- 
2.39.2





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux