io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roesch <shr@devkernel.io>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, kernel-team@fb.com,
	ammarfaizi2@gnuweeb.org,
	Olivier Langlois <olivier@trillion01.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH v12 2/5] io-uring: add napi busy poll support
Date: Thu, 04 May 2023 09:06:10 -0700	[thread overview]
Message-ID: <qvqwa5ykcc8b.fsf@devbig1114.prn1.facebook.com> (raw)
In-Reply-To: <acd78dcf-f145-d7d3-a30d-4b6694089023@kernel.dk>


Jens Axboe <axboe@kernel.dk> writes:

>
> I mentioned this in our out-of-band discussions on this patch set, and
> we cannot call napi_busy_loop() under rcu_read_lock() if loop_end and
> loop_end_arg is set AND loop_end() doesn't always return true. Because
> otherwise we can end up with napi_busy_loop() doing:
>
> 	if (unlikely(need_resched())) {
> 		if (napi_poll)
> 			busy_poll_stop(napi, have_poll_lock, prefer_busy_poll, budget);
> 		preempt_enable();
> 		rcu_read_unlock();
> 		cond_resched();
> 		if (loop_end(loop_end_arg, start_time))
> 			return;
> 		goto restart;
> 	}
>
> and hence we're now scheduling with rcu read locking disabled. So we
> need to handle that case appropriately as well.

I'll have a look.

  reply	other threads:[~2023-05-04 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 16:53 [PATCH v12 0/5] io_uring: add napi busy polling support Stefan Roesch
2023-05-02 16:53 ` [PATCH v12 1/5] io-uring: move io_wait_queue definition to header file Stefan Roesch
2023-05-02 16:53 ` [PATCH v12 2/5] io-uring: add napi busy poll support Stefan Roesch
2023-05-03 17:40   ` Jens Axboe
2023-05-04 16:06     ` Stefan Roesch [this message]
2023-05-02 16:53 ` [PATCH v12 3/5] io-uring: add sqpoll support for napi busy poll Stefan Roesch
2023-05-02 16:53 ` [PATCH v12 4/5] io_uring: add register/unregister napi function Stefan Roesch
2023-05-02 16:53 ` [PATCH v12 5/5] io_uring: add prefer busy poll to register and unregister napi api Stefan Roesch

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=qvqwa5ykcc8b.fsf@devbig1114.prn1.facebook.com \
    --to=shr@devkernel.io \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=olivier@trillion01.com \
    /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;
as well as URLs for NNTP newsgroup(s).