public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: 陈云星 <[email protected]>
Cc: [email protected]
Subject: Re: support suspend/resume SQPOLL on inflight io-uring instance
Date: Fri, 5 Jun 2020 07:13:02 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAP6wFtSZ1LOWsb=nXwnPGdcAWvpvwdHo_SUuMpnAcqbBdtfFRA@mail.gmail.com>

On 6/4/20 9:38 PM, 陈云星 wrote:
> io-uring instance can be set flag : IO_URING_SETUP_SQPOLL to enable
> kernel thread polling SQ. but some application have random io
> behavior, for example:
>      a). a burst read/write for a while,
>      b). then many scatter small io operations.
> 
> during a) period, use sqpoll will be beneficial to performance.
> but during b) period, use sqpoll will waste cpu time for empty busy poll.
> 
> If we can have a method to tell kernel start/stop poll sq when we
> need, it is good for both of a) and b):
>      in a) period, io_uring_enter tell kernel. start to poll
>      after a) , io_uring_enter tell kernel stop polling and.

We already have the start side of it, that's io_uring_enter() which should
be done when IORING_SQ_NEED_WAKEUP is set. I do like your suggestion of
making it go to sleep on demand instead of always waiting for the grace
period.

We recently added IORING_CQ_EVENTFD_DISABLED, and we can use the same
area for this as well. Eg add IORING_CQ_SQPOLL_SLEEP or something like
that, and have the sq thread look for it. If set, it'll stop busy looping
and go to sleep.

-- 
Jens Axboe


      reply	other threads:[~2020-06-05 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  3:38 support suspend/resume SQPOLL on inflight io-uring instance 陈云星
2020-06-05 13:13 ` Jens Axboe [this message]

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 \
    [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