Skip to content

Commit

Permalink
io_uring/zcrx: put refill data into separate cache line
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Apr 7, 2025
1 parent ab6005f commit 9b58440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io_uring/zcrx.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ struct io_zcrx_ifq {
struct io_ring_ctx *ctx;
struct io_zcrx_area *area;

spinlock_t rq_lock ____cacheline_aligned_in_smp;
struct io_uring *rq_ring;
struct io_uring_zcrx_rqe *rqes;
u32 rq_entries;
u32 cached_rq_head;
spinlock_t rq_lock;
u32 rq_entries;

u32 if_rxq;
struct device *dev;
Expand Down

0 comments on commit 9b58440

Please sign in to comment.