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: move io_unregister_zcrx_ifqs() down

In preparation for removing the ref on ctx->refs held by an ifq and
removing io_shutdown_zcrx_ifqs(), move io_unregister_zcrx_ifqs() down
such that it can call io_zcrx_scrub().

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

David Wei and committed by
Jens Axboe
1bd95163 5c686456

+22 -22
+22 -22
io_uring/zcrx.c
··· 662 662 return ret; 663 663 } 664 664 665 - void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx) 666 - { 667 - struct io_zcrx_ifq *ifq; 668 - 669 - lockdep_assert_held(&ctx->uring_lock); 670 - 671 - while (1) { 672 - scoped_guard(mutex, &ctx->mmap_lock) { 673 - unsigned long id = 0; 674 - 675 - ifq = xa_find(&ctx->zcrx_ctxs, &id, ULONG_MAX, XA_PRESENT); 676 - if (ifq) 677 - xa_erase(&ctx->zcrx_ctxs, id); 678 - } 679 - if (!ifq) 680 - break; 681 - io_zcrx_ifq_free(ifq); 682 - } 683 - 684 - xa_destroy(&ctx->zcrx_ctxs); 685 - } 686 - 687 665 static struct net_iov *__io_zcrx_get_free_niov(struct io_zcrx_area *area) 688 666 { 689 667 unsigned niov_idx; ··· 725 747 io_zcrx_scrub(ifq); 726 748 io_close_queue(ifq); 727 749 } 750 + } 751 + 752 + void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx) 753 + { 754 + struct io_zcrx_ifq *ifq; 755 + 756 + lockdep_assert_held(&ctx->uring_lock); 757 + 758 + while (1) { 759 + scoped_guard(mutex, &ctx->mmap_lock) { 760 + unsigned long id = 0; 761 + 762 + ifq = xa_find(&ctx->zcrx_ctxs, &id, ULONG_MAX, XA_PRESENT); 763 + if (ifq) 764 + xa_erase(&ctx->zcrx_ctxs, id); 765 + } 766 + if (!ifq) 767 + break; 768 + io_zcrx_ifq_free(ifq); 769 + } 770 + 771 + xa_destroy(&ctx->zcrx_ctxs); 728 772 } 729 773 730 774 static inline u32 io_zcrx_rqring_entries(struct io_zcrx_ifq *ifq)