Skip to contentSkip to conversation

block: reorder request_queue to remove 64 bit alignment padding

PATCH Applied Richard Kennedy 3 participants 3 messages Jul 11, 2011 – Jul 13, 2011 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: reorder request_queue to remove 64 bit alignment padding

Reorder request_queue to remove 16 bytes of alignment padding in 64 bit builds.

On my config this shrinks the size of this structure from 1608 to 1592 bytes and therefore needs one fewer cachelines.

Also trivially move the open bracket { to be on the same line as the structure name to make it easier to grep.

----

patch against v3.0-rc6
compiled & tested on x86_64

regards
Richard

include/linux/blkdev.h +6 -7
index 1a23722..c4649e8 100644
@@ -260,8 +260,7 @@ struct queue_limits {
 	unsigned char		discard_zeroes_data;
 };
 
-struct request_queue
-{
+struct request_queue {
 	/*
 	 * Together with queue_head for cacheline sharing
 	 */
@@ -304,14 +303,14 @@ struct request_queue
 	void			*queuedata;
 
 	/*
-	 * queue needs bounce pages for pages above this limit
+	 * various queue flags, see QUEUE_* below
 	 */
-	gfp_t			bounce_gfp;
+	unsigned long		queue_flags;
 
 	/*
-	 * various queue flags, see QUEUE_* below
+	 * queue needs bounce pages for pages above this limit
 	 */
-	unsigned long		queue_flags;
+	gfp_t			bounce_gfp;
 
 	/*
 	 * protects queue structures from reentrancy. ->__queue_lock should
@@ -334,8 +333,8 @@ struct request_queue
 	unsigned int		nr_congestion_off;
 	unsigned int		nr_batching;
 
-	void			*dma_drain_buffer;
 	unsigned int		dma_drain_size;
+	void			*dma_drain_buffer;
 	unsigned int		dma_pad_mask;
 	unsigned int		dma_alignment;
 
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 11 lines · Richard Kennedy

Reorder request_queue to remove 16 bytes of alignment padding in 64 bit builds.

On my config this shrinks the size of this structure from 1608 to 1592 bytes and therefore needs one fewer cachelines.

Also trivially move the open bracket { to be on the same line as the structure name to make it easier to grep.

Thank you.

Signature · 1 line
tejun
Applied
#2 lore raw
In reply to Richard Kennedy
Quoted 8 lines · Richard Kennedy

Reorder request_queue to remove 16 bytes of alignment padding in 64 bit builds.

On my config this shrinks the size of this structure from 1608 to 1592 bytes and therefore needs one fewer cachelines.

Also trivially move the open bracket { to be on the same line as the structure name to make it easier to grep.

Thanks, applied.

Signature · 1 line
Jens Axboe