linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: do not force irq affinity setting
Date: Thu, 26 Jun 2014 14:45:06 +0100	[thread overview]
Message-ID: <53AC23E2.6070306@arm.com> (raw)
In-Reply-To: <20140626102055.GD376@arm.com>

Hi Will,

On 26/06/14 11:20, Will Deacon wrote:
> Hello,
>
> On Thu, Jun 26, 2014 at 07:49:55AM +0100, Prashant Gaikwad wrote:
>> Unconditional copying cpu_online_mask to affinity
>> may result in migrating affinity to wrong CPU.
>
> We have a bug, but I don't follow your reasoning.
>
>> For example, IRQ 5 affinity mask contains CPU 4-7,
>
> Ok, so d->affinity is 0xf0...
>
>> it was affined to CPU4 and CPU 0-7 are online.
>
> ...and cpu_online_mask is 0xff.
>
>> Now if we hot-unplug CPU4 then with current
>> implementation affinity mask will contain
>> CPU 0-3,5-7 and IRQ 5 will be affined to CPU0.
>
> cpumask_any_and(affinity, cpu_online_mask) will give return < nr_cpu_ids
> since there is an intersection of 0xf0. That means ret is false.
>
> The bug is that we then do affinity = cpu_online_mask; unconditionally,
> but we *won't* do the cpumask_copy, since ret is false.
>
> You can fix this by simply bringing the arm64 code into line with the arm
> code, which begs the question as to why this has to exist in the arch/
> backend at all!
>

The unconditional assignment was added by me to fix CPU0 hotplug issue explained 
in commit 601c942176d8 which is wrong and evident from the above
usecase. It was added to retain the forced irq_set_affinity. The difference 
between arm and arm64 is because the arm doesn't have the patch [1]

We can move to irq_set_affinity without force option as this patch does.
I had mentioned similar solution[2], but Russell wants to get feedback from
tglx[3]

And yes I see similar implementations for many architectures, definitely
can be unified.

Regards,
Sudeep

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/254838.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/259255.html
[3] http://www.spinics.net/lists/arm-kernel/msg340279.html

      parent reply	other threads:[~2014-06-26 13:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  6:49 [PATCH] arm64: do not force irq affinity setting Prashant Gaikwad
2014-06-26 10:20 ` Will Deacon
2014-06-26 12:00   ` Prashant Gaikwad
2014-06-26 13:11     ` Will Deacon
2014-06-26 13:40       ` Prashant Gaikwad
2014-06-26 14:04         ` Sudeep Holla
2014-06-26 13:45   ` Sudeep Holla [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=53AC23E2.6070306@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=linux-arm-kernel@lists.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 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).