public inbox for [email protected]
 help / color / mirror / Atom feed
From: Olivier Langlois <[email protected]>
To: Hao Xu <[email protected]>, Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>
Cc: io-uring <[email protected]>,
	linux-kernel <[email protected]>
Subject: Re: [PATCH v4 2/2] io_uring: Add support for napi_busy_poll
Date: Tue, 01 Mar 2022 15:14:58 -0500	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Tue, 2022-03-01 at 15:06 -0500, Olivier Langlois wrote:
> On Wed, 2022-03-02 at 02:31 +0800, Hao Xu wrote:
> > 
> > 
> > How about:
> > 
> > if (list is singular) {
> > 
> >      do something;
> > 
> >      return;
> > 
> > }
> > 
> > while (!io_busy_loop_end() && io_napi_busy_loop())
> > 
> >      ;
> > 
> 
> is there a concern with the current code?
> What would be the benefit of your suggestion over current code?
> 
> To me, it seems that if io_blocking_napi_busy_loop() is called, a
> reasonable expectation would be that some busy looping is done or
> else
> you could return the function without doing anything which would,
> IMHO,
> be misleading.
> 
> By definition, napi_busy_loop() is not blocking and if you desire the
> device to be in busy poll mode, you need to do it once in a while or
> else, after a certain time, the device will return back to its
> interrupt mode.
> 
> IOW, io_blocking_napi_busy_loop() follows the same logic used by
> napi_busy_loop() that does not call loop_end() before having perform
> 1
> loop iteration.
> 
> > Btw, start_time seems not used in singular branch.
> 
> I know. This is why it is conditionally initialized.
> 
> Greetings,
> 
Another argument for not touching the code the way that it is:
io_napi_busy_loop() has another function on top of iterating the
napi_list and calling napi_busy_loop() for each of them.

The function also check the list entries validity and frees them when
they time out. Not calling io_napi_busy_loop() you would bypass this
check and that could result in timed out entries to never be disposed.


  reply	other threads:[~2022-03-01 20:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 13:47 [PATCH v4 0/2] io_uring: Add support for napi_busy_poll Olivier Langlois
2022-03-01 13:47 ` [PATCH v4 1/2] io_uring: minor io_cqring_wait() optimization Olivier Langlois
2022-03-01 13:47 ` [PATCH v4 2/2] io_uring: Add support for napi_busy_poll Olivier Langlois
2022-03-01 18:31   ` Hao Xu
2022-03-01 20:06     ` Olivier Langlois
2022-03-01 20:14       ` Olivier Langlois [this message]
2022-03-02  6:27       ` Hao Xu
2022-03-02  6:38         ` Hao Xu
2022-03-02 22:03           ` Olivier Langlois
2022-03-03  7:12             ` Hao Xu
2022-03-02  5:12     ` Olivier Langlois
2022-03-02  6:35       ` Hao Xu

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=628f7ac96c15b0a3d5f2ddcdf4df79a03950b17e.camel@trillion01.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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