block: define bvec_iter as __packed __aligned(4)
ANBZ: #11744 commit7838b46561
upstream. In commit19416123ab
("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: Linus Torvalds <torvalds@linux-foundation.org> Fixes:19416123ab
("block: define 'struct bvec_iter' as packed") Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com> Reviewed-by: Ferry Meng <mengferry@linux.alibaba.com> Reviewed-by: Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/4084
This commit is contained in:
parent
2c1b5030ee
commit
b36005760a
|
@ -43,7 +43,7 @@ struct bvec_iter {
|
|||
|
||||
unsigned int bi_bvec_done; /* number of bytes completed in
|
||||
current bvec */
|
||||
} __packed;
|
||||
} __packed __aligned(4);
|
||||
|
||||
struct bvec_iter_all {
|
||||
struct bio_vec bv;
|
||||
|
|
Loading…
Reference in New Issue