Skip to content

Commit

Permalink
block: define 'struct bvec_iter' as packed
Browse files Browse the repository at this point in the history
'struct bvec_iter' is embedded into 'struct bio', define it as packed
so that we can get one extra 4bytes for other uses without expanding
bio.

'struct bvec_iter' is often allocated on stack, so making it packed
doesn't affect performance. Also I have run io_uring on both
nvme/null_blk, and not observe performance effect in this way.

Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Tested-by: Mark Wunderlich <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Oct 18, 2021
1 parent 1a7e76e commit 1941612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/bvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct bvec_iter {

unsigned int bi_bvec_done; /* number of bytes completed in
current bvec */
};
} __packed;

struct bvec_iter_all {
struct bio_vec bv;
Expand Down

0 comments on commit 1941612

Please sign in to comment.