From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
ebiederm@xmission.com, "Toke Høiland-Jørgensen" <toke@redhat.com>,
"Kalle Valo" <kvalo@kernel.org>,
"Johannes Berg" <johannes@sipsolutions.net>
Subject: Re: [PATCH] signal: break out of wait loops on kthread_stop()
Date: Mon, 27 Jun 2022 16:54:54 +0200 [thread overview]
Message-ID: <YrnEvjcG8tmF3dRV@zx2c4.com> (raw)
In-Reply-To: <YrmwJyueoz1Z4ti0@hirez.programming.kicks-ass.net>
On Mon, Jun 27, 2022 at 03:27:03PM +0200, Peter Zijlstra wrote:
> On Mon, Jun 27, 2022 at 02:00:20PM +0200, Jason A. Donenfeld wrote:
>
> > +bool __kthread_should_stop(struct task_struct *k)
> > +{
> > + return (k->flags & PF_KTHREAD) &&
> > + test_bit(KTHREAD_SHOULD_STOP, &to_kthread(k)->flags);
> > +}
>
> This used to be a racy pattern; not sure it still is since Eric poked at
> this last, but please use __to_kthread() instead.
Ah, indeed. Will send a v2.
Jason
next prev parent reply other threads:[~2022-06-27 14:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 12:00 [PATCH] signal: break out of wait loops on kthread_stop() Jason A. Donenfeld
2022-06-27 13:27 ` Peter Zijlstra
2022-06-27 14:54 ` Jason A. Donenfeld [this message]
2022-06-27 14:57 ` [PATCH v2] " Jason A. Donenfeld
2022-06-27 19:16 ` Eric W. Biederman
2022-06-28 15:59 ` Jason A. Donenfeld
2022-06-28 16:14 ` [PATCH v3] " Jason A. Donenfeld
2022-07-04 12:22 ` Jason A. Donenfeld
2022-07-11 17:53 ` Jason A. Donenfeld
2022-07-11 18:57 ` Eric W. Biederman
2022-07-11 20:18 ` Jason A. Donenfeld
2022-07-11 20:21 ` [PATCH v4] " Jason A. Donenfeld
2022-07-11 22:05 ` Eric W. Biederman
2022-07-11 23:21 ` [PATCH v5] " Jason A. Donenfeld
2022-07-12 0:00 ` Eric W. Biederman
2022-07-12 0:18 ` Jason A. Donenfeld
2022-07-11 22:04 ` [PATCH v3] " Eric W. Biederman
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=YrnEvjcG8tmF3dRV@zx2c4.com \
--to=jason@zx2c4.com \
--cc=ebiederm@xmission.com \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=toke@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).