io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Fabian Ebner <f.ebner@proxmox.com>, io-uring@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 2/2] io_uring: don't block level reissue off completion path
Date: Wed, 28 Jul 2021 07:23:07 -0600	[thread overview]
Message-ID: <df686cb8-3d6e-f3ee-b767-b297434748e7@kernel.dk> (raw)
In-Reply-To: <70b7b7b2-c6d5-8088-ee76-c1ffc53ac2a3@proxmox.com>

On 7/28/21 3:26 AM, Fabian Ebner wrote:
> Am 27.07.21 um 18:58 schrieb Jens Axboe:
>> Some setups, like SCSI, can throw spurious -EAGAIN off the softirq
>> completion path. Normally we expect this to happen inline as part
>> of submission, but apparently SCSI has a weird corner case where it
>> can happen as part of normal completions.
>>
>> This should be solved by having the -EAGAIN bubble back up the stack
>> as part of submission, but previous attempts at this failed and we're
>> not just quite there yet. Instead we currently use REQ_F_REISSUE to
>> handle this case.
>>
>> For now, catch it in io_rw_should_reissue() and prevent a reissue
>> from a bogus path.
>>
>> Cc: stable@vger.kernel.org
>> Reported-by: Fabian Ebner <f.ebner@proxmox.com>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>> ---
>>   fs/io_uring.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index 6ba101cd4661..83f67d33bf67 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -2447,6 +2447,12 @@ static bool io_rw_should_reissue(struct io_kiocb *req)
>>   	 */
>>   	if (percpu_ref_is_dying(&ctx->refs))
>>   		return false;
>> +	/*
>> +	 * Play it safe and assume not safe to re-import and reissue if we're
>> +	 * not in the original thread group (or in task context).
>> +	 */
>> +	if (!same_thread_group(req->task, current) || !in_task())
>> +		return false;
>>   	return true;
>>   }
>>   #else
>>
> 
> Hi,
> 
> thank you for the fix! This does indeed prevent the panic (with 5.11.22) 
> and hang (with 5.13.3) with my problematic workload.

Perfect, thanks for re-testing! Can I add your Tested-by to the patch?

-- 
Jens Axboe


  reply	other threads:[~2021-07-28 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 16:58 [PATCH 0/2] Further async re-queue tightening/fix Jens Axboe
2021-07-27 16:58 ` [PATCH 1/2] io_uring: always reissue from task_work context Jens Axboe
2021-07-27 16:58 ` [PATCH 2/2] io_uring: don't block level reissue off completion path Jens Axboe
2021-07-28  9:26   ` Fabian Ebner
2021-07-28 13:23     ` Jens Axboe [this message]
2021-07-29  6:50       ` Fabian Ebner

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=df686cb8-3d6e-f3ee-b767-b297434748e7@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=f.ebner@proxmox.com \
    --cc=io-uring@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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).