All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Peter Zijlstra <peterz@infradead.org>, Will Deacon <Will.Deacon@arm.com>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	Marc Zyngier <marc.zyngier@arm.com>,
	"Frederic Weisbecker" <fweisbec@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	"Noam Camus" <noamc@ezchip.com>,
	arcml <linux-snps-arc@lists.infradead.org>
Subject: Re: Interesting csd deadlock on ARC
Date: Thu, 25 Feb 2016 19:53:39 +0530	[thread overview]
Message-ID: <56CF0E6B.5020903@synopsys.com> (raw)
In-Reply-To: <20160225140654.GL6357@twins.programming.kicks-ass.net>

On Thursday 25 February 2016 07:36 PM, Peter Zijlstra wrote:
> On Wed, Feb 24, 2016 at 10:21:25AM +0530, Vineet Gupta wrote:
>>>> What I actually meant was is it OK for irq_work_queue_on() to be called locally
>>>> (is this a sched bug/optimization(. Further if it is OK to be called, does it need
>>>> to do behave more like irq_work_queue() i.e. call arch_irq_work_raise() or
>>>> arch_send_call_function_single_ipi() is expected to handle sending IPI to self !
>>>
>>> Right, so I'm not actually sure we started out with this requirement.
>>> But you're not the first to run into this, see:
>>>
>>>   lkml.kernel.org/r/CAJZ5v0gLankSuziQq25qTCyNqeOX43yD9jnJu_XXwbdyajfmKg@mail.gmail.com
>>>
>>> Initially I think irq_work_queue_on() was only used remotely, but I
>>> think it makes sense to allow the current cpu, esp. since people seem to
>>> be using it like that.
>>
>> So it seems Russell's questions in the thread above stands still. IMO we need to
>> massage irq_work_queue_on() to handle the case of called for local cpu. This will
>> automatically take care of CONFIG_SMP kernel running on UP hardware.
> 
> Hmm, I missed that there was still an open question.
> 
> Afaict the only thing that needs doing to the generic code is drop the
> CONFIG_SMP guard, no?

But then ARM CONFIG_SMP on UP hardware will still crap out because there is no way
to send IPI to self. Same as the bug in above discussion. I'm surprised they way
ARM guys worked around it.

But yeah what you propose needs to be done and additionally make
irq_work_queue_on() behave like irq_work_queue() if @cpu == smp_processor_id(). So
the IPI will not be involved at all. But that means arch has to implement
arch_irq_work_raise() or maybe not - per comment there "Lame architectures will
get the timer tick callback" !

This would be a cleaner solution IMHO !

WARNING: multiple messages have this Message-ID (diff)
From: Vineet.Gupta1@synopsys.com (Vineet Gupta)
To: linux-snps-arc@lists.infradead.org
Subject: Interesting csd deadlock on ARC
Date: Thu, 25 Feb 2016 19:53:39 +0530	[thread overview]
Message-ID: <56CF0E6B.5020903@synopsys.com> (raw)
In-Reply-To: <20160225140654.GL6357@twins.programming.kicks-ass.net>

On Thursday 25 February 2016 07:36 PM, Peter Zijlstra wrote:
> On Wed, Feb 24, 2016@10:21:25AM +0530, Vineet Gupta wrote:
>>>> What I actually meant was is it OK for irq_work_queue_on() to be called locally
>>>> (is this a sched bug/optimization(. Further if it is OK to be called, does it need
>>>> to do behave more like irq_work_queue() i.e. call arch_irq_work_raise() or
>>>> arch_send_call_function_single_ipi() is expected to handle sending IPI to self !
>>>
>>> Right, so I'm not actually sure we started out with this requirement.
>>> But you're not the first to run into this, see:
>>>
>>>   lkml.kernel.org/r/CAJZ5v0gLankSuziQq25qTCyNqeOX43yD9jnJu_XXwbdyajfmKg at mail.gmail.com
>>>
>>> Initially I think irq_work_queue_on() was only used remotely, but I
>>> think it makes sense to allow the current cpu, esp. since people seem to
>>> be using it like that.
>>
>> So it seems Russell's questions in the thread above stands still. IMO we need to
>> massage irq_work_queue_on() to handle the case of called for local cpu. This will
>> automatically take care of CONFIG_SMP kernel running on UP hardware.
> 
> Hmm, I missed that there was still an open question.
> 
> Afaict the only thing that needs doing to the generic code is drop the
> CONFIG_SMP guard, no?

But then ARM CONFIG_SMP on UP hardware will still crap out because there is no way
to send IPI to self. Same as the bug in above discussion. I'm surprised they way
ARM guys worked around it.

But yeah what you propose needs to be done and additionally make
irq_work_queue_on() behave like irq_work_queue() if @cpu == smp_processor_id(). So
the IPI will not be involved at all. But that means arch has to implement
arch_irq_work_raise() or maybe not - per comment there "Lame architectures will
get the timer tick callback" !

This would be a cleaner solution IMHO !

  reply	other threads:[~2016-02-25 14:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  6:47 Interesting csd deadlock on ARC Vineet Gupta
2016-02-19  6:47 ` Vineet Gupta
2016-02-23  5:21 ` Vineet Gupta
2016-02-23  5:21   ` Vineet Gupta
2016-02-23  9:58   ` Peter Zijlstra
2016-02-23  9:58     ` Peter Zijlstra
2016-02-23  9:58     ` Peter Zijlstra
2016-02-23 10:21     ` Vineet Gupta
2016-02-23 10:21       ` Vineet Gupta
2016-02-23 10:39       ` Peter Zijlstra
2016-02-23 10:39         ` Peter Zijlstra
2016-02-23 10:58         ` Noam Camus
2016-02-23 10:58           ` Noam Camus
2016-02-23 10:58           ` Noam Camus
2016-02-24  4:45           ` Vineet Gupta
2016-02-24  4:45             ` Vineet Gupta
2016-02-24  4:51     ` Vineet Gupta
2016-02-24  4:51       ` Vineet Gupta
2016-02-25 14:06       ` Peter Zijlstra
2016-02-25 14:06         ` Peter Zijlstra
2016-02-25 14:06         ` Peter Zijlstra
2016-02-25 14:23         ` Vineet Gupta [this message]
2016-02-25 14:23           ` Vineet Gupta
2016-02-25 14:30           ` Russell King - ARM Linux
2016-02-25 14:30             ` Russell King - ARM Linux
2016-02-25 15:58             ` Vineet Gupta
2016-02-25 15:58               ` Vineet Gupta

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=56CF0E6B.5020903@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Will.Deacon@arm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=noamc@ezchip.com \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.