Re: [PATCH 2/2] io_uring: unlock if __io_run_local_work locked inside

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

 



On Thu, 2022-10-27 at 09:38 -0600, Jens Axboe wrote:
> On 10/27/22 8:44 AM, Dylan Yudaken wrote:
> > It is possible for tw to lock the ring, and this was not propogated
> > out to
> > io_run_local_work. This can cause an unlock to be missed.
> > 
> > Instead pass a pointer to locked into __io_run_local_work.
> > 
> > Fixes: 8ac5d85a89b4 ("io_uring: add local task_work run helper that
> > is entered locked")
> > Signed-off-by: Dylan Yudaken <dylany@xxxxxxxx>
> > ---
> > 
> > +       if (WARN_ON(!locked))
> > +               mutex_lock(&ctx->uring_lock);
> > +       return ret;
> >  }
> 
> If you think warning on !locked is a good idea, it should be a
> WARN_ON_ONCE(). Or is this leftover debugging?
> 

It's not leftover. Basically it should not be (afaik) that tw will
unlock the mutex, but I didn't want to leave a dangling unlocked mutex.

Maybe that is being too conservative and we can just kill both lines -
we never used to check for this.

Happy for either way

Dylan




[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