linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  block: remove 16 bytes of padding from struct request on 64bits
@ 2010-03-18 10:19 Richard Kennedy
  2010-03-19  7:57 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Kennedy @ 2010-03-18 10:19 UTC (permalink / raw)
  To: Jens Axboe; +Cc: lkml

Remove alignment padding to shrink struct request from 336 to 320 bytes
so needing one fewer cacheline and therefore removing 48 bytes from
struct request_queue.


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

regards
Richard


diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ebd22db..6b66438 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -158,7 +158,6 @@ enum rq_flag_bits {
 struct request {
 	struct list_head queuelist;
 	struct call_single_data csd;
-	int cpu;
 
 	struct request_queue *q;
 
@@ -166,9 +165,11 @@ struct request {
 	enum rq_cmd_type_bits cmd_type;
 	unsigned long atomic_flags;
 
+	int cpu;
+
 	/* the following two fields are internal, NEVER access directly */
-	sector_t __sector;		/* sector cursor */
 	unsigned int __data_len;	/* total data len */
+	sector_t __sector;		/* sector cursor */
 
 	struct bio *bio;
 	struct bio *biotail;
@@ -201,20 +202,20 @@ struct request {
 
 	unsigned short ioprio;
 
+	int ref_count;
+
 	void *special;		/* opaque pointer available for LLD use */
 	char *buffer;		/* kaddr of the current segment if available */
 
 	int tag;
 	int errors;
 
-	int ref_count;
-
 	/*
 	 * when request is used as a packet command carrier
 	 */
-	unsigned short cmd_len;
 	unsigned char __cmd[BLK_MAX_CDB];
 	unsigned char *cmd;
+	unsigned short cmd_len;
 
 	unsigned int extra_len;	/* length of alignment and padding */
 	unsigned int sense_len;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]  block: remove 16 bytes of padding from struct request on  64bits
  2010-03-18 10:19 [PATCH] block: remove 16 bytes of padding from struct request on 64bits Richard Kennedy
@ 2010-03-19  7:57 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2010-03-19  7:57 UTC (permalink / raw)
  To: Richard Kennedy; +Cc: lkml

On Thu, Mar 18 2010, Richard Kennedy wrote:
> Remove alignment padding to shrink struct request from 336 to 320 bytes
> so needing one fewer cacheline and therefore removing 48 bytes from
> struct request_queue.

Thanks Richard, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-19  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 10:19 [PATCH] block: remove 16 bytes of padding from struct request on 64bits Richard Kennedy
2010-03-19  7:57 ` Jens Axboe

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).