public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Xuan Zhuo <[email protected]>,
	io-uring <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] io_uring: fix req cannot arm poll after polled
Date: Tue, 30 Jun 2020 08:02:23 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <2ebb186ebbef9c5a01e27317aae664e9011acf86.1593520864.git.xuanzhuo@linux.alibaba.com>

On 6/30/20 6:41 AM, Xuan Zhuo wrote:
> For example, there are multiple sqes recv with the same connection.
> When there is no data in the connection, the reqs of these sqes will
> be armed poll. Then if only a little data is received, only one req
> receives the data, and the other reqs get EAGAIN again. However,
> due to this flags REQ_F_POLLED, these reqs cannot enter the
> io_arm_poll_handler function. These reqs will be put into wq by
> io_queue_async_work, and the flags passed by io_wqe_worker when recv
> is called are BLOCK, which may make io_wqe_worker enter schedule in the
> network protocol stack. When the main process of io_uring exits,
> these io_wqe_workers still cannot exit. The connection will not be
> actively released until the connection is closed by the peer.
> 
> So we should allow req to arm poll again.

I was actually pondering this when I wrote it, and was worried about
potential performance implications from only allowing a single trigger
of the poll side. But only for performance reasons, I'm puzzled as
to why this would cause a cancelation issue.

Why can't the workers exit? It's expected to be waiting in there,
and it should be interruptible sleep. Do you have more details on
the test case, maybe even a reproducer for this?

-- 
Jens Axboe


  parent reply	other threads:[~2020-06-30 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 12:41 [PATCH] io_uring: fix req cannot arm poll after polled Xuan Zhuo
2020-06-30 12:59 ` Pavel Begunkov
2020-06-30 14:02 ` Jens Axboe [this message]
2020-07-01 12:47 ` Xuan Zhuo

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