public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Cc: bpf@vger.kernel.org, Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH v6 1/5] io_uring: introduce callback driven main loop
Date: Mon, 16 Feb 2026 08:49:14 -0700	[thread overview]
Message-ID: <0b2d5fa2-77b8-4b0d-b90f-d073ea671fbe@kernel.dk> (raw)
In-Reply-To: <efa65f15822f686bc2a8abda7ba799d3cf46f6c3.1770836401.git.asml.silence@gmail.com>

On 2/11/26 12:04 PM, Pavel Begunkov wrote:
> +static int __io_run_loop(struct io_ring_ctx *ctx)
> +{
> +	struct iou_loop_state ls = {};
> +
> +	while (true) {
> +		unsigned nr_wait;
> +		int step_res;
> +
> +		if (unlikely(!ctx->loop_step))
> +			return -EFAULT;
> +
> +		step_res = ctx->loop_step(ctx, &ls.p);
> +		if (step_res == IOU_LOOP_STOP)
> +			break;
> +		if (step_res != IOU_LOOP_CONTINUE)
> +			return -EINVAL;
> +
> +		nr_wait = io_loop_nr_cqes(ctx, &ls);
> +		if (nr_wait > 0)
> +			io_loop_wait(ctx, &ls, nr_wait);
> +
> +		if (task_work_pending(current)) {
> +			mutex_unlock(&ctx->uring_lock);
> +			io_run_task_work();
> +			mutex_lock(&ctx->uring_lock);
> +		}
> +		if (unlikely(task_sigpending(current)))
> +			return -EINTR;
> +
> +		nr_wait = max(nr_wait, 0);
> +		io_run_local_work_locked(ctx, nr_wait);
> +
> +		if (READ_ONCE(ctx->check_cq) & BIT(IO_CHECK_CQ_OVERFLOW_BIT))
> +			io_cqring_do_overflow_flush(ctx);

We need a __io_cqring_do_overflow_flush() or similar here that already
has ->uring_lock held. Or The same dropping/regetting of the lock as is
done for io_run_task_work().

-- 
Jens Axboe

  reply	other threads:[~2026-02-16 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 19:04 [PATCH io_uring-7.1 v6 0/5] BPF controlled io_uring Pavel Begunkov
2026-02-11 19:04 ` [PATCH v6 1/5] io_uring: introduce callback driven main loop Pavel Begunkov
2026-02-16 15:49   ` Jens Axboe [this message]
2026-02-11 19:04 ` [PATCH v6 2/5] io_uring/bpf-ops: implement loop_step with BPF struct_ops Pavel Begunkov
2026-02-11 19:04 ` [PATCH v6 3/5] io_uring/bpf-ops: add kfunc helpers Pavel Begunkov
2026-02-11 19:04 ` [PATCH v6 4/5] io_uring/bpf-ops: implement bpf ops registration Pavel Begunkov
2026-02-11 19:04 ` [PATCH v6 5/5] selftests/io_uring: add a bpf io_uring selftest Pavel Begunkov
2026-02-16 14:23 ` [PATCH io_uring-7.1 v6 0/5] BPF controlled io_uring Pavel Begunkov
2026-02-16 15:18   ` Jens Axboe
2026-02-17 11:29     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b2d5fa2-77b8-4b0d-b90f-d073ea671fbe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=alexei.starovoitov@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox