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: open code io_account_cq_overflow()

io_account_cq_overflow() doesn't help explaining what's going on in
there, and it'll become even smaller with following patches, so open
code it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e4333fa0d371f519e52a71148ebdffed4b8d3aa9.1746788718.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
b0c8a640 19a94da4

+4 -9
+4 -9
io_uring/io_uring.c
··· 381 381 return NULL; 382 382 } 383 383 384 - static void io_account_cq_overflow(struct io_ring_ctx *ctx) 385 - { 386 - struct io_rings *r = ctx->rings; 387 - 388 - WRITE_ONCE(r->cq_overflow, READ_ONCE(r->cq_overflow) + 1); 389 - ctx->cq_extra--; 390 - } 391 - 392 384 static void io_clean_op(struct io_kiocb *req) 393 385 { 394 386 if (unlikely(req->flags & REQ_F_BUFFER_SELECTED)) ··· 734 742 ocqe = kmalloc(ocq_size, GFP_ATOMIC | __GFP_ACCOUNT); 735 743 trace_io_uring_cqe_overflow(ctx, user_data, res, cflags, ocqe); 736 744 if (!ocqe) { 745 + struct io_rings *r = ctx->rings; 746 + 737 747 /* 738 748 * If we're in ring overflow flush mode, or in task cancel mode, 739 749 * or cannot allocate an overflow entry, then we need to drop it 740 750 * on the floor. 741 751 */ 742 - io_account_cq_overflow(ctx); 752 + WRITE_ONCE(r->cq_overflow, READ_ONCE(r->cq_overflow) + 1); 753 + ctx->cq_extra--; 743 754 set_bit(IO_CHECK_CQ_DROPPED_BIT, &ctx->check_cq); 744 755 return false; 745 756 }