Skip to content

Commit

Permalink
block: reorder request_queue to remove 64 bit alignment padding
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Richard Kennedy authored and Jens Axboe committed Jul 13, 2011
1 parent 7700fc4 commit d7b7630
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand All @@ -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;

Expand Down

0 comments on commit d7b7630

Please sign in to comment.