public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Hao Xu <[email protected]>, [email protected]
Cc: Jens Axboe <[email protected]>
Subject: Re: [PATCH] io_uring: avoid iowq again trap
Date: Sun, 15 May 2022 15:21:33 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 5/15/22 08:31, Hao Xu wrote:
> On 5/13/22 18:24, Pavel Begunkov wrote:
>> If an opcode handler semi-reliably returns -EAGAIN, io_wq_submit_work()
> 
> Hi Pavel,
> When would it return -EAGAIN in non-IOPOLL mode?

I didn't see it in the wild but stumbled upon while preparing some
future patches. I hope it's not a real issue, but it's better to not
leave a way for some driver/etc. to abuse it.


>> might continue busily hammer the same handler over and over again, which
>> is not ideal. The -EAGAIN handling in question was put there only for
>> IOPOLL, so restrict it to IOPOLL mode only.
>>
>> Signed-off-by: Pavel Begunkov <[email protected]>
>> ---
>>   fs/io_uring.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index e01f595f5b7d..3af1905efc78 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -7319,6 +7319,8 @@ static void io_wq_submit_work(struct io_wq_work *work)
>>            * wait for request slots on the block side.
>>            */
>>           if (!needs_poll) {
>> +            if (!(req->ctx->flags & IORING_SETUP_IOPOLL))
>> +                break;
>>               cond_resched();
>>               continue;
>>           }
> 

-- 
Pavel Begunkov

  reply	other threads:[~2022-05-15 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 10:24 [PATCH] io_uring: avoid iowq again trap Pavel Begunkov
2022-05-13 12:31 ` Jens Axboe
2022-05-13 12:49   ` Pavel Begunkov
2022-05-13 12:50     ` Jens Axboe
2022-05-13 12:51 ` Jens Axboe
2022-05-15  7:31 ` Hao Xu
2022-05-15 14:21   ` Pavel Begunkov [this message]
2022-05-15 15:07     ` 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 \
    [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