public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reduce size of struct buffer_head on 64bit
@ 2004-08-15 21:30 Anton Blanchard
  0 siblings, 0 replies; only message in thread
From: Anton Blanchard @ 2004-08-15 21:30 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, jrsantos


Reduce size of buffer_head from 96 to 88 bytes on 64bit architectures by
putting b_count and b_size together. b_count will still be in the first
16 bytes on 32bit architectures, so 16 byte cacheline machines shouldnt
be affected.

With this change the number of objects per 4kB slab goes up from
40 to 44 on ppc64.

Signed-off-by: Anton Blanchard <anton@samba.org>

diff -puN include/linux/buffer_head.h~optimize_structs include/linux/buffer_head.h
--- gr_work/include/linux/buffer_head.h~optimize_structs	2004-08-14 10:51:08.695492352 -0500
+++ gr_work-anton/include/linux/buffer_head.h	2004-08-14 10:51:08.716489022 -0500
@@ -47,12 +47,12 @@ typedef void (bh_end_io_t)(struct buffer
 struct buffer_head {
 	/* First cache line: */
 	unsigned long b_state;		/* buffer state bitmap (see above) */
-	atomic_t b_count;		/* users using this block */
 	struct buffer_head *b_this_page;/* circular list of page's buffers */
 	struct page *b_page;		/* the page this bh is mapped to */
+	atomic_t b_count;		/* users using this block */
+	u32 b_size;			/* block size */
 
 	sector_t b_blocknr;		/* block number */
-	u32 b_size;			/* block size */
 	char *b_data;			/* pointer to data block */
 
 	struct block_device *b_bdev;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-15 21:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-15 21:30 [PATCH] reduce size of struct buffer_head on 64bit Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox