Skip to content
Snippets Groups Projects
Commit 0e351d1a authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman
Browse files

block: define bvec_iter as __packed __aligned(4)


[ Upstream commit 7838b465 ]

In commit 19416123 ("block: define 'struct bvec_iter' as packed"),
what we need is to save the 4byte padding, and avoid `bio` to spread on
one extra cache line.

It is enough to define it as '__packed __aligned(4)', as '__packed'
alone means byte aligned, and can cause compiler to generate horrible
code on architectures that don't support unaligned access in case that
bvec_iter is embedded in other structures.

Cc: Mikulas Patocka <mpatocka@redhat.com>
Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Fixes: 19416123 ("block: define 'struct bvec_iter' as packed")
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c6ff5fb6
No related branches found
No related tags found
Loading
...@@ -59,7 +59,7 @@ struct bvec_iter { ...@@ -59,7 +59,7 @@ struct bvec_iter {
unsigned int bi_bvec_done; /* number of bytes completed in unsigned int bi_bvec_done; /* number of bytes completed in
current bvec */ current bvec */
} __packed; } __packed __aligned(4);
struct bvec_iter_all { struct bvec_iter_all {
struct bio_vec bv; struct bio_vec bv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment