linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Kennedy <richard@rsk.demon.co.uk>
To: Theodore Ts'o <tytso@mit.edu>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org
Subject: [PATCH] ext4: remove alignment padding from ext4_inode_info on 64 bit builds
Date: Wed, 18 Aug 2010 16:08:08 +0100	[thread overview]
Message-ID: <1282144088.2068.16.camel@castor.rsk> (raw)

Reorder structure ext4_inode_info to remove 16 bytes of alignment
padding on 64 bit builds. This shrinks its size from 904 to 888 bytes
with (CONFIG_EXT4_S_XATTR=y && CONFIG_QUOTA=n).
    
This will allow this structure to use one fewer cache lines.

Also change type of i_delalloc_reserved_flag to bool to better reflect
its usage.

compiled & tested on x86_64
    
Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
---
patch against 2.6.36-rc1

Early testing shows more consistent results ( i.e. smaller standard
deviations) on my AMD X2 setup, but I shall re-run these tests to check
if this is repeatable.

regards
Richard


diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 889ec9d..b63a8e3 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -750,10 +750,11 @@ struct ext4_inode_info {
 	 * near to their parent directory's inode.
 	 */
 	ext4_group_t	i_block_group;
-	unsigned long	i_state_flags;		/* Dynamic state flags */
-	unsigned long	i_flags;
 
 	ext4_lblk_t		i_dir_start_lookup;
+
+	unsigned long	i_state_flags;		/* Dynamic state flags */
+	unsigned long	i_flags;
 #ifdef CONFIG_EXT4_FS_XATTR
 	/*
 	 * Extended attributes can be read independently of the main file
@@ -816,13 +817,14 @@ struct ext4_inode_info {
 	unsigned int i_reserved_data_blocks;
 	unsigned int i_reserved_meta_blocks;
 	unsigned int i_allocated_meta_blocks;
-	unsigned short i_delalloc_reserved_flag;
-	sector_t i_da_metadata_calc_last_lblock;
-	int i_da_metadata_calc_len;
+	bool i_delalloc_reserved_flag;
 
 	/* on-disk additional length */
 	__u16 i_extra_isize;
 
+	sector_t i_da_metadata_calc_last_lblock;
+	int i_da_metadata_calc_len;
+
 	spinlock_t i_block_reservation_lock;
 #ifdef CONFIG_QUOTA
 	/* quota space reservation, managed internally by quota code */

             reply	other threads:[~2010-08-18 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 15:08 Richard Kennedy [this message]
2010-08-20 20:11 ` [PATCH] ext4: remove alignment padding from ext4_inode_info on 64 bit builds Eric Sandeen
2010-08-21 12:31   ` Richard Kennedy
2010-08-21 16:41     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282144088.2068.16.camel@castor.rsk \
    --to=richard@rsk.demon.co.uk \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).