linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] io_uring: fix uring_flush in exit_files() warning
       [not found] ` <20210117023108.3748-1-hdanton@sina.com>
@ 2021-01-17  2:40   ` Pavel Begunkov
  0 siblings, 0 replies; only message in thread
From: Pavel Begunkov @ 2021-01-17  2:40 UTC (permalink / raw)
  To: Hillf Danton
  Cc: Jens Axboe, linux-kernel, io-uring, syzbot+a32b546d58dde07875a1

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-17  2:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1610774936.git.asml.silence@gmail.com>
     [not found] ` <20210117023108.3748-1-hdanton@sina.com>
2021-01-17  2:40   ` [PATCH 2/2] io_uring: fix uring_flush in exit_files() warning Pavel Begunkov

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).