Re: [GIT PULL] io_uring fixes for 6.10-rc4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/14/24 12:29 PM, Linus Torvalds wrote:
> On Fri, 14 Jun 2024 at 09:06, Jens Axboe <axboe@xxxxxxxxx> wrote:
>>
>> - Ensure that the task state is correct before attempting to grab a
>>   mutex
> 
> This code is horrid.
> 
> That code *also* does
> 
>                 schedule();
>                 __set_current_state(TASK_RUNNING);
> 
> which makes no sense at all. If you just returned from schedule(), you
> *will* be running.

Yeah agree, not sure why that __set_current_state() is after schedule(),
that's obviously not needed.

> The reason you need that
> 
>                         __set_current_state(TASK_RUNNING);
> 
> in the *other* place is the very fact that you didn't call schedule at
> all after doing a
> 
>                 prepare_to_wait(&ctx->rsrc_quiesce_wq, &we, TASK_INTERRUPTIBLE);
> 
> So the bug was that the code had the __set_current_state() in exactly
> the wrong place.
> 
> But the fix didn't remove the bogus one, so it all looks entirely like
> voodoo.

I'll kill that other redundant one.

-- 
Jens Axboe





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux