Skip to content

Commit 9b58440

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: put refill data into separate cache line
Refill queue lock and other bits are only used from the allocation path on the rx softirq side, but it shares the cache line with other fields like ctx that are used also in the "syscall" path, which causes cache bouncing when softirq runs on a different CPU. Separate them into different cache lines. The first one now contains constant fields used by both contextx, followed by a line responsible for refill queue data. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/6d1f598e27d623c07fc49d6baee13089a9b1216c.1743848241.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ab6005f commit 9b58440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

io_uring/zcrx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ struct io_zcrx_ifq {
2626
struct io_ring_ctx *ctx;
2727
struct io_zcrx_area *area;
2828

29+
spinlock_t rq_lock ____cacheline_aligned_in_smp;
2930
struct io_uring *rq_ring;
3031
struct io_uring_zcrx_rqe *rqes;
31-
u32 rq_entries;
3232
u32 cached_rq_head;
33-
spinlock_t rq_lock;
33+
u32 rq_entries;
3434

3535
u32 if_rxq;
3636
struct device *dev;

0 commit comments

Comments
 (0)