io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org, io-uring@vger.kernel.org,
	syzbot+a32b546d58dde07875a1@syzkaller.appspotmail.com
Subject: Re: [PATCH 2/2] io_uring: fix uring_flush in exit_files() warning
Date: Sun, 17 Jan 2021 02:40:22 +0000	[thread overview]
Message-ID: <4a938355-94f4-4b90-f10e-270df7c2a0d9@gmail.com> (raw)
In-Reply-To: <20210117023108.3748-1-hdanton@sina.com>

On 17/01/2021 02:31, Hillf Danton wrote:
> On Sat, 16 Jan 2021 05:32:30 +0000 Pavel Begunkov wrote:
>>
>> @@ -9126,7 +9126,10 @@ static int io_uring_flush(struct file *file, void *data)
>>  
>>  	if (ctx->flags & IORING_SETUP_SQPOLL) {
>>  		/* there is only one file note, which is owned by sqo_task */
>> -		WARN_ON_ONCE((ctx->sqo_task == current) ==
>> +		WARN_ON_ONCE(ctx->sqo_task != current &&
>> +			     xa_load(&tctx->xa, (unsigned long)file));
>> +		/* sqo_dead check is for when this happens after cancellation */
>> +		WARN_ON_ONCE(ctx->sqo_task == current && !ctx->sqo_dead &&
>>  			     !xa_load(&tctx->xa, (unsigned long)file));
>>  
>>  		io_disable_sqo_submit(ctx);
> 
> The added sqo_dead flag can not only quiesce a warning but save a
> disabling dryrun.

Don't think I get the sentence. Do you see any issue?

sqo_dead has a practical meaning, it prevents SQPOLL task from poking
into the creator task when it's racy. But yes, also in some cases makes
draining and killing rings nicer. 

-- 
Pavel Begunkov

      parent reply	other threads:[~2021-01-17  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16  5:32 [PATCH 0/2] syzbot warning reports Pavel Begunkov
2021-01-16  5:32 ` [PATCH 1/2] io_uring: fix false positive sqo warning on flush Pavel Begunkov
2021-01-16  5:32 ` [PATCH 2/2] io_uring: fix uring_flush in exit_files() warning Pavel Begunkov
2021-01-16 19:01 ` [PATCH 0/2] syzbot warning reports Jens Axboe
     [not found] ` <20210117023108.3748-1-hdanton@sina.com>
2021-01-17  2:40   ` Pavel Begunkov [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 \
    --in-reply-to=4a938355-94f4-4b90-f10e-270df7c2a0d9@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hdanton@sina.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+a32b546d58dde07875a1@syzkaller.appspotmail.com \
    /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).