All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
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 15:27:03 +0200	[thread overview]
Message-ID: <YrmwJyueoz1Z4ti0@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20220627120020.608117-1-Jason@zx2c4.com>

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.

  reply	other threads:[~2022-06-27 13:27 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 [this message]
2022-06-27 14:54   ` Jason A. Donenfeld
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=YrmwJyueoz1Z4ti0@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.