Commit 857f4318 authored by Caleb Sander Mateos's avatar Caleb Sander Mateos Committed by Jens Axboe
Browse files

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: default avatarCaleb Sander Mateos <csander@purestorage.com>
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250620151008.3976463-15-csander@purestorage.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c9d066eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;