mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Junaid Shahid <junaids@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,
	Andres Lagar-Cavilla <andreslc@google.com>,
	Greg Thelen <gthelen@google.com>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] kthread: Fix race condition between kthread_parkme() and kthread_unpark()
Date: Fri, 29 Sep 2017 09:59:55 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1709290958450.1890@nanos> (raw)
In-Reply-To: <CAL-GctE0BLVk=ps09dnir8pcpnfzg88jMK4CKkRVmY7-ho87nQ@mail.gmail.com>

On Thu, 28 Sep 2017, Junaid Shahid wrote:

> Hi Peter,
> 
> It looks like try_cmpxchg is not available on non-x86 archs, but other than
> that the version that you proposed looks good.
> 
> One thing that I am a bit curious about is that the original code, before
> either patch, had a test_and_set_bit for KTHREAD_IS_PARKED rather than just
> a set_bit. I can't think of any reason why that was needed, since it
> doesn't look like TASK_PARKED tasks are susceptible to spurious wakeups. Do
> you by any chance happen to know if there was any specific reason for it?

Everything is susceptible to spurious wakeups and has to deal with it.

Thanks,

	tglx

  parent reply	other threads:[~2017-09-29  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29  2:32 Junaid Shahid
2017-05-30 22:37 ` Junaid Shahid
2017-05-30 22:40   ` Andrew Morton
2017-07-18  0:13     ` Junaid Shahid
2017-07-18  6:35       ` Thomas Gleixner
2017-09-27 12:17 ` Peter Zijlstra
     [not found]   ` <CAL-GctE0BLVk=ps09dnir8pcpnfzg88jMK4CKkRVmY7-ho87nQ@mail.gmail.com>
2017-09-29  7:59     ` Thomas Gleixner [this message]
2017-09-29  8:28       ` Peter Zijlstra
2017-09-29 20:58         ` Junaid Shahid

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=alpine.DEB.2.20.1709290958450.1890@nanos \
    --to=tglx@linutronix.de \
    --cc=andreslc@google.com \
    --cc=gthelen@google.com \
    --cc=junaids@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®