public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: "byungchul.park@lge.com" <byungchul.park@lge.com>,
	Will Deacon <Will.Deacon@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm64: take onlined cpus into account when setting irq affinity in migrate_one_irq
Date: Wed, 27 Aug 2014 11:40:00 +0100	[thread overview]
Message-ID: <53FDB580.8050009@arm.com> (raw)
In-Reply-To: <1409131832-11317-1-git-send-email-byungchul.park@lge.com>



On 27/08/14 10:30, byungchul.park@lge.com wrote:
> From: Byungchul Park <byungchul.park@lge.com>
>
> This patch ensures that the cpu being offlined is not present in the affinity mask.
>

I agree that this patch fixes the issue reported in [1] without
disabling forced set affinity mask. However Thomas responded yesterday
asking to disable it [2] on the original thread for ARM. I have
responded on the thread and waiting for feedback from rmk and tglx. I
would prefer to wait and align with ARM code if possible.

> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>   arch/arm64/kernel/irq.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c
> index 473e5db..0c7b79e 100644
> --- a/arch/arm64/kernel/irq.c
> +++ b/arch/arm64/kernel/irq.c
> @@ -87,6 +87,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
>   {
>   	struct irq_data *d = irq_desc_get_irq_data(desc);
>   	const struct cpumask *affinity = d->affinity;
> +	struct cpumask tmp_affinity;
>   	struct irq_chip *c;
>   	bool ret = false;
>
> @@ -100,6 +101,14 @@ static bool migrate_one_irq(struct irq_desc *desc)
>   	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
>   		affinity = cpu_online_mask;
>   		ret = true;
> +	} else {
> +		/*
> +		 * 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
> +		 */
> +		cpumask_and(&tmp_affinity, affinity, cpu_online_mask);

In case we decide to retain forced set affinity, you can probably squash 
this cpumask_and with the above cpumask_any_and.

> +		affinity = &tmp_affinity;
>   	}
>
>   	c = irq_data_get_irq_chip(d);
>

Regards,
Sudeep

[1] 
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/266785.html
[2] 
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/281548.html


  reply	other threads:[~2014-08-27 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27  9:30 [PATCH 2/2] arm64: take onlined cpus into account when setting irq affinity in migrate_one_irq byungchul.park
2014-08-27 10:40 ` Sudeep Holla [this message]
2014-08-28  7:00   ` byungchul park

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=53FDB580.8050009@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=byungchul.park@lge.com \
    --cc=linux-kernel@vger.kernel.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