Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1741962

Re: [PATCH] kthread: Fix race condition between kthread_parkme() and kthread_unpark()

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] kthread: Fix race condition between kthread_parkme() and kthread_unpark()
Date 2017-09-29 10:10 +0200
Message-ID <uuYwW-3Do-17@gated-at.bofh.it> (permalink)
References <tBqsF-8mn-1@gated-at.bofh.it> <uujtM-2gN-11@gated-at.bofh.it> <uuYwW-3Do-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] kthread: Fix race condition between kthread_parkme() and  kthread_unpark() Peter Zijlstra <peterz@infradead.org> - 2017-09-27 14:20 +0200
  Re: [PATCH] kthread: Fix race condition between kthread_parkme()  and kthread_unpark() Thomas Gleixner <tglx@linutronix.de> - 2017-09-29 10:10 +0200
    Re: [PATCH] kthread: Fix race condition between kthread_parkme() and  kthread_unpark() Peter Zijlstra <peterz@infradead.org> - 2017-09-29 10:30 +0200
      Re: [PATCH] kthread: Fix race condition between kthread_parkme() and kthread_unpark() Junaid Shahid <junaids@google.com> - 2017-09-29 23:00 +0200

csiph-web