Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/zcrx: use guards for the refill lock

Use guards for rq_lock in io_zcrx_ring_refill(), makes it a tad simpler.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
c95257f3 73fa880e

+2 -5
+2 -5
io_uring/zcrx.c
··· 756 756 unsigned int mask = ifq->rq_entries - 1; 757 757 unsigned int entries; 758 758 759 - spin_lock_bh(&ifq->rq_lock); 759 + guard(spinlock_bh)(&ifq->rq_lock); 760 760 761 761 entries = io_zcrx_rqring_entries(ifq); 762 762 entries = min_t(unsigned, entries, PP_ALLOC_CACHE_REFILL - pp->alloc.count); 763 - if (unlikely(!entries)) { 764 - spin_unlock_bh(&ifq->rq_lock); 763 + if (unlikely(!entries)) 765 764 return; 766 - } 767 765 768 766 do { 769 767 struct io_uring_zcrx_rqe *rqe = io_zcrx_get_rqe(ifq, mask); ··· 799 801 } while (--entries); 800 802 801 803 smp_store_release(&ifq->rq_ring->head, ifq->cached_rq_head); 802 - spin_unlock_bh(&ifq->rq_lock); 803 804 } 804 805 805 806 static void io_zcrx_refill_slow(struct page_pool *pp, struct io_zcrx_ifq *ifq)