mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Daniel McNeil <daniel@osdl.org>
Subject: [PATCH] fs : reorder some 'struct inode' fields to speedup i_size manipulations
Date: Thu, 23 Nov 2006 11:57:29 +0100	[thread overview]
Message-ID: <200611231157.30056.dada1@cosmosbay.com> (raw)
In-Reply-To: <20061123004053.76114a75.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

On 32bits SMP platforms, 64bits i_size is protected by a seqcount 
(i_size_seqcount).

When i_size is read or written, i_size_seqcount is read/written as well, so it 
make sense to group these two fields together in the same cache line.

Before this patch, accessing i_size needed 3 cache lines (2 for i_size, one 
for i_size_seqcount). After, only one cache line is needed/ (dirtied on a 
i_size change).

This patch moves i_size_seqcount next to i_size, and also moves i_version to 
let offsetof(struct inode, i_size) being 0x40 instead of 0x3c (for 32bits 
platforms). 

For 64 bits platforms, i_size_seqcount doesnt exist, and the move of a 'long 
i_version' should not introduce a new hole because of padding.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

[-- Attachment #2: move_i_size_seqcount.patch --]
[-- Type: text/plain, Size: 816 bytes --]

--- linux-2.6.19-rc6/include/linux/fs.h	2006-11-23 10:47:53.000000000 +0100
+++ linux-2.6.19-rc6-ed/include/linux/fs.h	2006-11-23 11:13:36.000000000 +0100
@@ -548,12 +548,15 @@ struct inode {
 	uid_t			i_uid;
 	gid_t			i_gid;
 	dev_t			i_rdev;
+	unsigned long		i_version;
 	loff_t			i_size;
+#ifdef __NEED_I_SIZE_ORDERED
+	seqcount_t		i_size_seqcount;
+#endif
 	struct timespec		i_atime;
 	struct timespec		i_mtime;
 	struct timespec		i_ctime;
 	unsigned int		i_blkbits;
-	unsigned long		i_version;
 	blkcnt_t		i_blocks;
 	unsigned short          i_bytes;
 	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */
@@ -598,9 +601,6 @@ struct inode {
 	void			*i_security;
 #endif
 	void			*i_private; /* fs or device private pointer */
-#ifdef __NEED_I_SIZE_ORDERED
-	seqcount_t		i_size_seqcount;
-#endif
 };
 
 /*

  parent reply	other threads:[~2006-11-23 10:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 14:17 [PATCH -mm 0/4][AIO] - AIO completion signal notification v2 Sébastien Dugué
2006-11-20 14:22 ` [PATCH -mm 1/4][AIO] - fix aio.h includes Sébastien Dugué
2006-11-20 13:31   ` Zach Brown
2006-11-20 14:22 ` [PATCH -mm 2/4][AIO] - export good_sigevent() Sébastien Dugué
2006-11-20 13:42   ` Zach Brown
2006-11-20 21:45     ` Ulrich Drepper
2006-11-20 14:02       ` Zach Brown
2006-11-20 14:22 ` [PATCH -mm 3/4][AIO] - AIO completion signal notification Sébastien Dugué
2006-11-20 15:13   ` Zach Brown
2006-11-21 10:40     ` Sébastien Dugué
     [not found]     ` <20061122104055.3d1c029a@frecb000686>
2006-11-22 10:22       ` Zach Brown
2006-11-23  8:24         ` Sébastien Dugué
2006-11-22  1:02   ` Andrew Morton
2006-11-23  8:28     ` Sébastien Dugué
2006-11-23  8:40       ` Andrew Morton
2006-11-23  9:47         ` Sébastien Dugué
2006-11-23 10:14           ` Andrew Morton
2006-11-23 10:27             ` Sébastien Dugué
2006-11-23 10:57         ` Eric Dumazet [this message]
2006-11-27 21:37           ` [PATCH] fs : reorder some 'struct inode' fields to speedup i_size manipulations Andrew Morton
2006-11-27 21:52             ` Eric Dumazet
2006-11-27 22:01               ` Andrew Morton
2006-11-28 20:31                 ` Eric Dumazet
2006-11-20 14:23 ` [PATCH -mm 4/4][AIO] - Listio support Sébastien Dugué
2006-11-21 10:35   ` Suparna Bhattacharya
2006-11-27 13:39   ` Bharata B Rao

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=200611231157.30056.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@osdl.org \
    --cc=daniel@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®