* [PATCH io_uring 1/1] io_uring/zcrx: fix rq flush locking
@ 2026-02-01 21:19 Pavel Begunkov
2026-02-02 15:21 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2026-02-01 21:19 UTC (permalink / raw)
To: io-uring; +Cc: asml.silence, axboe, netdev
zcrx needs to keep the rq lock for uref manipulations, for now move all
zcrx_return_buffers() under the lock.
Fixes: 475eb39b00478 ("io_uring/zcrx: add sync refill queue flushing")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
io_uring/zcrx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 0c4b339f712e..d8b6db456bd7 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -1097,8 +1097,6 @@ static unsigned zcrx_parse_rq(netmem_ref *netmem_array, unsigned nr,
unsigned int mask = zcrx->rq_entries - 1;
unsigned int i;
- guard(spinlock_bh)(&zcrx->rq_lock);
-
nr = min(nr, io_zcrx_rqring_entries(zcrx));
for (i = 0; i < nr; i++) {
struct io_uring_zcrx_rqe *rqe = io_zcrx_get_rqe(zcrx, mask);
@@ -1143,9 +1141,11 @@ static int zcrx_flush_rq(struct io_ring_ctx *ctx, struct io_zcrx_ifq *zcrx,
return -EINVAL;
do {
- nr = zcrx_parse_rq(netmems, ZCRX_FLUSH_BATCH, zcrx);
+ scoped_guard(spinlock_bh, &zcrx->rq_lock) {
+ nr = zcrx_parse_rq(netmems, ZCRX_FLUSH_BATCH, zcrx);
+ zcrx_return_buffers(netmems, nr);
+ }
- zcrx_return_buffers(netmems, nr);
total += nr;
if (fatal_signal_pending(current))
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH io_uring 1/1] io_uring/zcrx: fix rq flush locking
2026-02-01 21:19 [PATCH io_uring 1/1] io_uring/zcrx: fix rq flush locking Pavel Begunkov
@ 2026-02-02 15:21 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2026-02-02 15:21 UTC (permalink / raw)
To: io-uring, Pavel Begunkov; +Cc: netdev
On Sun, 01 Feb 2026 21:19:56 +0000, Pavel Begunkov wrote:
> zcrx needs to keep the rq lock for uref manipulations, for now move all
> zcrx_return_buffers() under the lock.
>
>
Applied, thanks!
[1/1] io_uring/zcrx: fix rq flush locking
commit: af07330e28ad65352126270b0b3af226df46e307
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-02 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-01 21:19 [PATCH io_uring 1/1] io_uring/zcrx: fix rq flush locking Pavel Begunkov
2026-02-02 15:21 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox