From: Dylan Yudaken <[email protected]>
To: Dylan Yudaken <[email protected]>,
"[email protected]" <[email protected]>,
"[email protected]" <[email protected]>
Cc: Kernel Team <[email protected]>,
"[email protected]" <[email protected]>
Subject: Re: [PATCH 2/2] io_uring: unlock if __io_run_local_work locked inside
Date: Thu, 27 Oct 2022 15:50:38 +0000 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
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 <[email protected]>
> > ---
> >
> > + 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
next prev parent reply other threads:[~2022-10-27 15:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 14:44 [PATCH 0/2] io_uring: fix locking in __io_run_local_work Dylan Yudaken
2022-10-27 14:44 ` [PATCH 1/2] io_uring: use io_run_local_work_locked helper Dylan Yudaken
2022-10-27 14:44 ` [PATCH 2/2] io_uring: unlock if __io_run_local_work locked inside Dylan Yudaken
2022-10-27 15:38 ` Jens Axboe
2022-10-27 15:50 ` Dylan Yudaken [this message]
2022-10-27 15:52 ` [PATCH 0/2] io_uring: fix locking in __io_run_local_work Jens Axboe
2022-10-27 15:57 ` Jens Axboe
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=aff511d235d730ee0a31fc29dc6bb94ff3bdd80c.camel@fb.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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