mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Subbaraman Narayanamurthy <subbaram@codeaurora.org>,
	daniel@numascale.com, yuyang.du@intel.com,
	linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: hotplug thread issues
Date: Fri, 7 Nov 2014 10:39:48 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1411071037440.3789@nanos> (raw)
In-Reply-To: <20141106150150.GT10501@worktop.programming.kicks-ass.net>

On Thu, 6 Nov 2014, Peter Zijlstra wrote:

> Hi Thomas,
> 
> So there have been some reports on hitting:
> 
>   BUG_ON(td->cpu != smp_processor_id());
> 
> in smpboot_thread_fn.
> 
> Now I've been staring at this for a wee bit today and I've found two
> issues, but I'm not sure either are enough to explain the observed.
> 
> 1) smpboot_register_percpu_thread() seems to lack serialization against
>    hotplug. It has a for_each_online() loop, but no get_online_cpus() --
>    unlike smpboot_unregister_percpu_thread, which does.
> 
>    Typical usage like spawn_ksoftirqd() should be fine, they're early
>    init calls and those run before we bring up the other CPUs. Therefore
>    this does not explain the observation that its ksoftirqd/n triggering
>    the BUG.
> 
>    However, the usage in proc_dowatchdog() is susceptible to this race
>    and its entirely possible to go wrong there.

Hmm. Need to have a look.
 
> 
> 2) the usage of __set_current_state(TASK_PARKED) in __kthread_parkme()
>    is wrong AFAICT, one should always use set_current_state() for
>    setting !TASK_RUNNING state. The comment with set_current_state()
>    explains why.
> 
>    This would've allowed the test_bit(KTHREAD_SHOULD_PARK) load to have
>    been satisfied before the store of TASK_PARKED.

My bad. Can you send a proper patch addressing that issue please? That
should be tagged stable as well I guess.

Thanks,

	tglx



  reply	other threads:[~2014-11-07  9:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 15:01 Peter Zijlstra
2014-11-07  9:39 ` Thomas Gleixner [this message]
2014-11-07 10:28   ` [PATCH]: kthread: Fix memory ordering in __kthread_parkme Peter Zijlstra
2014-11-07 18:41     ` Oleg Nesterov
2014-11-07 21:27       ` Peter Zijlstra

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.11.1411071037440.3789@nanos \
    --to=tglx@linutronix.de \
    --cc=daniel@numascale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=subbaram@codeaurora.org \
    --cc=yuyang.du@intel.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

all inboxes | Powered by JetHome®