On Mon, 2022-08-15 at 15:02 +0100, Pavel Begunkov wrote: > > - if ((flags & IORING_ENTER_GETEVENTS) && ctx- > > >syscall_iopoll) > > + > > + if (!(flags & IORING_ENTER_GETEVENTS)) > > + mutex_unlock(&ctx->uring_lock); > > + else if (ctx->syscall_iopoll) > > goto iopoll_locked; > > - mutex_unlock(&ctx->uring_lock); > > - io_run_task_work(); > > + else > > + io_run_task_work_unlock_ctx(ctx); > > Let's unroll this function and get rid of conditional > locking, especially since you don't need the io_run_task_work() > part here. I am struggling to figure out how to do this cleanly in v2 as I don't want to break the existing codepath that skips the unlock/lock for iopoll. I'll post v2 anyway - but please let me know if my solution isn't what you were thinking Dylan