From: Caleb Sander Mateos Date: Fri, 20 Jun 2025 15:10:08 +0000 (-0600) Subject: ublk: cache-align struct ublk_io X-Git-Tag: v6.17-rc1~205^2~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=857f431824aacb22bd051c0f4c44c708659028b1;p=thirdparty%2Flinux.git ublk: cache-align struct ublk_io struct ublk_io is already 56 bytes on 64-bit architectures, so round it up to a full cache line (typically 64 bytes). This ensures a single ublk_io doesn't span multiple cache lines and prevents false sharing if consecutive ublk_io's are accessed by different daemon tasks. Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20250620151008.3976463-15-csander@purestorage.com Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index eec3abb78ce5c..e52c2d1cb8383 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -188,7 +188,7 @@ struct ublk_io { /* auto-registered buffer, valid if UBLK_IO_FLAG_AUTO_BUF_REG is set */ u16 buf_index; void *buf_ctx_handle; -}; +} ____cacheline_aligned_in_smp; struct ublk_queue { int q_id;