]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: define bvec_iter as __packed __aligned(4)
authorMing Lei <ming.lei@redhat.com>
Sun, 25 Feb 2024 03:01:41 +0000 (11:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:48:44 +0000 (14:48 +0000)
commit2664bb298cdfc387c5fb5a2140bc9aa1bc72319c
treeb896eeda262e051a3c1adb3bc47bbd4ce14614a8
parent21bbe847686cde6d726f67f6528483058281069e
block: define bvec_iter as __packed __aligned(4)

[ Upstream commit 7838b4656110d950afdd92a081cc0f33e23e0ea8 ]

In commit 19416123ab3e ("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: 19416123ab3e ("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: Sasha Levin <sashal@kernel.org>
include/linux/bvec.h