linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sodagudi Prasad <psodagud@codeaurora.org>,
	mingo@kernel.org, gregkh@linuxfoundation.org,
	bigeasy@linutronix.de, isaacm@codeaurora.org,
	linux-kernel@vger.kernel.org
Subject: Re: cpu stopper threads and setaffinity leads to deadlock
Date: Fri, 3 Aug 2018 13:41:13 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1808031340500.1745@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20180802094908.GK2494@hirez.programming.kicks-ass.net>

Prasad.

On Thu, 2 Aug 2018, Peter Zijlstra wrote:
> 
> So why didn't you do the 'obvious' parallel to what you did for
> cpu_stop_queue_two_works(), namely:

Is that patch fixing the issue for you?

> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -81,6 +81,7 @@ static bool cpu_stop_queue_work(unsigned
>  	unsigned long flags;
>  	bool enabled;
>  
> +	preempt_disable();
>  	raw_spin_lock_irqsave(&stopper->lock, flags);
>  	enabled = stopper->enabled;
>  	if (enabled)
> @@ -90,6 +91,7 @@ static bool cpu_stop_queue_work(unsigned
>  	raw_spin_unlock_irqrestore(&stopper->lock, flags);
>  
>  	wake_up_q(&wakeq);
> +	preempt_enable();
>  
>  	return enabled;
>  }
> 

  reply	other threads:[~2018-08-03 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  1:34 cpu stopper threads and setaffinity leads to deadlock Sodagudi Prasad
2018-08-02  8:12 ` Peter Zijlstra
2018-08-02  8:27   ` Mike Galbraith
2018-08-02  8:45 ` Peter Zijlstra
2018-08-02  9:49 ` Peter Zijlstra
2018-08-03 11:41   ` Thomas Gleixner [this message]
2018-08-03 18:57     ` Sodagudi Prasad

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.21.1808031340500.1745@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=isaacm@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=psodagud@codeaurora.org \
    /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).