public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity"
@ 2014-08-27  9:30 byungchul.park
  2014-08-28  9:38 ` Will Deacon
  0 siblings, 1 reply; 5+ messages in thread
From: byungchul.park @ 2014-08-27  9:30 UTC (permalink / raw)
  To: will.deacon; +Cc: sudeep.holla, catalin.marinas, linux-kernel, Byungchul Park

From: Byungchul Park <byungchul.park@lge.com>

This reverts commit 601c942176d8ad8334118bddb747e3720bed24f8.

This patch is designed to ensure that the cpu being offlined is not
present in the affinity mask. But it is a bad idea to overwrite the
affinity variable with cpu_online_mask, even in case that the current
affinity already includes onlined cpus.

So revert this patch to replace it with another one doing exactly
what it intends.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 arch/arm64/kernel/irq.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c
index 0f08dfd..473e5db 100644
--- a/arch/arm64/kernel/irq.c
+++ b/arch/arm64/kernel/irq.c
@@ -97,15 +97,11 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
 		return false;
 
-	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids)
+	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+		affinity = cpu_online_mask;
 		ret = true;
+	}
 
-	/*
-	 * when using forced irq_set_affinity we must ensure that the cpu
-	 * being offlined is not present in the affinity mask, it may be
-	 * selected as the target CPU otherwise
-	 */
-	affinity = cpu_online_mask;
 	c = irq_data_get_irq_chip(d);
 	if (!c->irq_set_affinity)
 		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity"
  2014-08-27  9:30 [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity" byungchul.park
@ 2014-08-28  9:38 ` Will Deacon
  2014-08-28  9:49   ` Sudeep Holla
  0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2014-08-28  9:38 UTC (permalink / raw)
  To: byungchul.park@lge.com
  Cc: Sudeep Holla, Catalin Marinas, linux-kernel@vger.kernel.org

On Wed, Aug 27, 2014 at 10:30:06AM +0100, byungchul.park@lge.com wrote:
> From: Byungchul Park <byungchul.park@lge.com>
> 
> This reverts commit 601c942176d8ad8334118bddb747e3720bed24f8.
> 
> This patch is designed to ensure that the cpu being offlined is not
> present in the affinity mask. But it is a bad idea to overwrite the
> affinity variable with cpu_online_mask, even in case that the current
> affinity already includes onlined cpus.
> 
> So revert this patch to replace it with another one doing exactly
> what it intends.

Sudeep: what's the right way forward for this? There seems to be general
agreement that the existing code is broken, but a bunch of different
`fixes'. Can we just take a straight port of what tglx proposed for ARM?
(changing force to false)

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity"
  2014-08-28  9:38 ` Will Deacon
@ 2014-08-28  9:49   ` Sudeep Holla
  2014-08-28  9:50     ` Will Deacon
  0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2014-08-28  9:49 UTC (permalink / raw)
  To: Will Deacon, byungchul.park@lge.com
  Cc: Sudeep Holla, Catalin Marinas, linux-kernel@vger.kernel.org



On 28/08/14 10:38, Will Deacon wrote:
> On Wed, Aug 27, 2014 at 10:30:06AM +0100, byungchul.park@lge.com wrote:
>> From: Byungchul Park <byungchul.park@lge.com>
>>
>> This reverts commit 601c942176d8ad8334118bddb747e3720bed24f8.
>>
>> This patch is designed to ensure that the cpu being offlined is not
>> present in the affinity mask. But it is a bad idea to overwrite the
>> affinity variable with cpu_online_mask, even in case that the current
>> affinity already includes onlined cpus.
>>
>> So revert this patch to replace it with another one doing exactly
>> what it intends.
>
> Sudeep: what's the right way forward for this? There seems to be general
> agreement that the existing code is broken, but a bunch of different
> `fixes'. Can we just take a straight port of what tglx proposed for ARM?
> (changing force to false)
>

Yes I agree but for that we need agreement from rmk and hence I asked to
wait till we hear from rmk. Main issue raised by rmk is if some other
interrupt controller implementation decide not to migrate away when
force is false(theoretically possible).

Regards,
Sudeep


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity"
  2014-08-28  9:49   ` Sudeep Holla
@ 2014-08-28  9:50     ` Will Deacon
  2014-08-28  9:55       ` Sudeep Holla
  0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2014-08-28  9:50 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: byungchul.park@lge.com, Catalin Marinas,
	linux-kernel@vger.kernel.org

On Thu, Aug 28, 2014 at 10:49:54AM +0100, Sudeep Holla wrote:
> 
> 
> On 28/08/14 10:38, Will Deacon wrote:
> > On Wed, Aug 27, 2014 at 10:30:06AM +0100, byungchul.park@lge.com wrote:
> >> From: Byungchul Park <byungchul.park@lge.com>
> >>
> >> This reverts commit 601c942176d8ad8334118bddb747e3720bed24f8.
> >>
> >> This patch is designed to ensure that the cpu being offlined is not
> >> present in the affinity mask. But it is a bad idea to overwrite the
> >> affinity variable with cpu_online_mask, even in case that the current
> >> affinity already includes onlined cpus.
> >>
> >> So revert this patch to replace it with another one doing exactly
> >> what it intends.
> >
> > Sudeep: what's the right way forward for this? There seems to be general
> > agreement that the existing code is broken, but a bunch of different
> > `fixes'. Can we just take a straight port of what tglx proposed for ARM?
> > (changing force to false)
> >
> 
> Yes I agree but for that we need agreement from rmk and hence I asked to
> wait till we hear from rmk. Main issue raised by rmk is if some other
> interrupt controller implementation decide not to migrate away when
> force is false(theoretically possible).

Okey doke. Whatever solution we take should be the same for arm and arm64,
so I'll leave it with you.

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity"
  2014-08-28  9:50     ` Will Deacon
@ 2014-08-28  9:55       ` Sudeep Holla
  0 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2014-08-28  9:55 UTC (permalink / raw)
  To: Will Deacon
  Cc: Sudeep Holla, byungchul.park@lge.com, Catalin Marinas,
	linux-kernel@vger.kernel.org



On 28/08/14 10:50, Will Deacon wrote:
> On Thu, Aug 28, 2014 at 10:49:54AM +0100, Sudeep Holla wrote:
>>
>>
>> On 28/08/14 10:38, Will Deacon wrote:
>>> On Wed, Aug 27, 2014 at 10:30:06AM +0100, byungchul.park@lge.com wrote:
>>>> From: Byungchul Park <byungchul.park@lge.com>
>>>>
>>>> This reverts commit 601c942176d8ad8334118bddb747e3720bed24f8.
>>>>
>>>> This patch is designed to ensure that the cpu being offlined is not
>>>> present in the affinity mask. But it is a bad idea to overwrite the
>>>> affinity variable with cpu_online_mask, even in case that the current
>>>> affinity already includes onlined cpus.
>>>>
>>>> So revert this patch to replace it with another one doing exactly
>>>> what it intends.
>>>
>>> Sudeep: what's the right way forward for this? There seems to be general
>>> agreement that the existing code is broken, but a bunch of different
>>> `fixes'. Can we just take a straight port of what tglx proposed for ARM?
>>> (changing force to false)
>>>
>>
>> Yes I agree but for that we need agreement from rmk and hence I asked to
>> wait till we hear from rmk. Main issue raised by rmk is if some other
>> interrupt controller implementation decide not to migrate away when
>> force is false(theoretically possible).
>
> Okey doke. Whatever solution we take should be the same for arm and arm64,
> so I'll leave it with you.
>

tglx just confirmed that interrupt controller implementation using force
flag must use online_cpumask. So converting to false should be fine.
So once rmk agrees for ARM, we can apply this revert and change to false
for ARM64 also.

Regards,
Sudeep


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-28  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  9:30 [PATCH 1/2] Revert "arm64: use cpu_online_mask when using forced irq_set_affinity" byungchul.park
2014-08-28  9:38 ` Will Deacon
2014-08-28  9:49   ` Sudeep Holla
2014-08-28  9:50     ` Will Deacon
2014-08-28  9:55       ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox