linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sodagudi Prasad <psodagud@codeaurora.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.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, 03 Aug 2018 11:57:23 -0700	[thread overview]
Message-ID: <712493a7926b0f58543be052ced95db9@codeaurora.org> (raw)
In-Reply-To: <alpine.DEB.2.21.1808031340500.1745@nanos.tec.linutronix.de>

On 2018-08-03 04:41, Thomas Gleixner wrote:
> 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?
<Prasad> Hi Thomas and Peter,

Yes. Tested both versions of patches and both variants are working on 
Qualcomm devices
with stress testing of set affinity and tasks cross-migration, which 
were previously leading to the deadlock.

-Thanks, Prasad
> 
>> --- 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;
>>  }
>> 

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

      reply	other threads:[~2018-08-03 18:57 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
2018-08-03 18:57     ` Sodagudi Prasad [this message]

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=712493a7926b0f58543be052ced95db9@codeaurora.org \
    --to=psodagud@codeaurora.org \
    --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=tglx@linutronix.de \
    /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).