From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Cc: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
metag <linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [patch 06/26] metag: Use irq_set_affinity instead of homebrewn code
Date: Mon, 24 Feb 2014 13:24:13 +0000 [thread overview]
Message-ID: <530B47FD.80608@imgtec.com> (raw)
In-Reply-To: <20140223212736.887575774-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3117 bytes --]
Hi Thomas,
On 23/02/14 21:40, Thomas Gleixner wrote:
> There is no point in having an incomplete copy of irq_set_affinity()
> for the hotplug irq migration code.
That sounds reasonable, but when I gave it a try I started getting
warnings on the log after offlining one cpu then the other:
META213-Thread0 DSP [LogF] IRQ13 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ14 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ15 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ18 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ29 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ30 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ31 no longer affine to CPU1
It appears that the irq affinities weren't getting modified previously,
whereas now irq_do_set_affinity() does do cpumask_copy(data->affinity,
mask). Once all CPUs have been offlined at least once you get those
spurious messages even though the IRQ affinities haven't been explicitly
limited by anything.
I wonder if the stored affinity should really be altered in this case?
Cheers
James
>
> Use the core function instead and while at it switch to
> for_each_active_irq()
>
> Signed-off-by: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> Cc: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
> Cc: metag <linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
> ---
> arch/metag/kernel/irq.c | 20 +++-----------------
> 1 file changed, 3 insertions(+), 17 deletions(-)
>
> Index: tip/arch/metag/kernel/irq.c
> ===================================================================
> --- tip.orig/arch/metag/kernel/irq.c
> +++ tip/arch/metag/kernel/irq.c
> @@ -261,18 +261,6 @@ int __init arch_probe_nr_irqs(void)
> }
>
> #ifdef CONFIG_HOTPLUG_CPU
> -static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
> -{
> - struct irq_desc *desc = irq_to_desc(irq);
> - struct irq_chip *chip = irq_data_get_irq_chip(data);
> - unsigned long flags;
> -
> - raw_spin_lock_irqsave(&desc->lock, flags);
> - if (chip->irq_set_affinity)
> - chip->irq_set_affinity(data, cpumask_of(cpu), false);
> - raw_spin_unlock_irqrestore(&desc->lock, flags);
> -}
> -
> /*
> * The CPU has been marked offline. Migrate IRQs off this CPU. If
> * the affinity settings do not allow other CPUs, force them onto any
> @@ -281,10 +269,9 @@ static void route_irq(struct irq_data *d
> void migrate_irqs(void)
> {
> unsigned int i, cpu = smp_processor_id();
> - struct irq_desc *desc;
>
> - for_each_irq_desc(i, desc) {
> - struct irq_data *data = irq_desc_get_irq_data(desc);
> + for_each_active_irq(i) {
> + struct irq_data *data = irq_get_irq_data(i);
> unsigned int newcpu;
>
> if (irqd_is_per_cpu(data))
> @@ -303,8 +290,7 @@ void migrate_irqs(void)
> newcpu = cpumask_any_and(data->affinity,
> cpu_online_mask);
> }
> -
> - route_irq(data, i, newcpu);
> + irq_set_affinity(i, cpumask_of(newcpu));
> }
> }
> #endif /* CONFIG_HOTPLUG_CPU */
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
"Peter Zijlstra" <peterz@infradead.org>,
metag <linux-metag@vger.kernel.org>
Subject: Re: [patch 06/26] metag: Use irq_set_affinity instead of homebrewn code
Date: Mon, 24 Feb 2014 13:24:13 +0000 [thread overview]
Message-ID: <530B47FD.80608@imgtec.com> (raw)
In-Reply-To: <20140223212736.887575774@linutronix.de>
[-- Attachment #1: Type: text/plain, Size: 3038 bytes --]
Hi Thomas,
On 23/02/14 21:40, Thomas Gleixner wrote:
> There is no point in having an incomplete copy of irq_set_affinity()
> for the hotplug irq migration code.
That sounds reasonable, but when I gave it a try I started getting
warnings on the log after offlining one cpu then the other:
META213-Thread0 DSP [LogF] IRQ13 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ14 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ15 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ18 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ29 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ30 no longer affine to CPU1
META213-Thread0 DSP [LogF] IRQ31 no longer affine to CPU1
It appears that the irq affinities weren't getting modified previously,
whereas now irq_do_set_affinity() does do cpumask_copy(data->affinity,
mask). Once all CPUs have been offlined at least once you get those
spurious messages even though the IRQ affinities haven't been explicitly
limited by anything.
I wonder if the stored affinity should really be altered in this case?
Cheers
James
>
> Use the core function instead and while at it switch to
> for_each_active_irq()
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: metag <linux-metag@vger.kernel.org>
> ---
> arch/metag/kernel/irq.c | 20 +++-----------------
> 1 file changed, 3 insertions(+), 17 deletions(-)
>
> Index: tip/arch/metag/kernel/irq.c
> ===================================================================
> --- tip.orig/arch/metag/kernel/irq.c
> +++ tip/arch/metag/kernel/irq.c
> @@ -261,18 +261,6 @@ int __init arch_probe_nr_irqs(void)
> }
>
> #ifdef CONFIG_HOTPLUG_CPU
> -static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
> -{
> - struct irq_desc *desc = irq_to_desc(irq);
> - struct irq_chip *chip = irq_data_get_irq_chip(data);
> - unsigned long flags;
> -
> - raw_spin_lock_irqsave(&desc->lock, flags);
> - if (chip->irq_set_affinity)
> - chip->irq_set_affinity(data, cpumask_of(cpu), false);
> - raw_spin_unlock_irqrestore(&desc->lock, flags);
> -}
> -
> /*
> * The CPU has been marked offline. Migrate IRQs off this CPU. If
> * the affinity settings do not allow other CPUs, force them onto any
> @@ -281,10 +269,9 @@ static void route_irq(struct irq_data *d
> void migrate_irqs(void)
> {
> unsigned int i, cpu = smp_processor_id();
> - struct irq_desc *desc;
>
> - for_each_irq_desc(i, desc) {
> - struct irq_data *data = irq_desc_get_irq_data(desc);
> + for_each_active_irq(i) {
> + struct irq_data *data = irq_get_irq_data(i);
> unsigned int newcpu;
>
> if (irqd_is_per_cpu(data))
> @@ -303,8 +290,7 @@ void migrate_irqs(void)
> newcpu = cpumask_any_and(data->affinity,
> cpu_online_mask);
> }
> -
> - route_irq(data, i, newcpu);
> + irq_set_affinity(i, cpumask_of(newcpu));
> }
> }
> #endif /* CONFIG_HOTPLUG_CPU */
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-02-24 13:24 UTC|newest]
Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-23 21:40 [patch 00/26] genirq: Another round of tree wide cleanups Thomas Gleixner
2014-02-23 21:40 ` [patch 01/26] powerpc: irq: Use generic_handle_irq Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:39 ` [tip:irq/core] powerpc: Irq: " tip-bot for Thomas Gleixner
2014-03-04 16:39 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 02/26] powerpc:evh_pic: Kill irq_desc abuse Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:39 ` [tip:irq/core] powerpc:eVh_pic: " tip-bot for Thomas Gleixner
2014-03-04 16:39 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 03/26] powerpc: eeh: Kill another abuse of irq_desc Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-23 22:26 ` Benjamin Herrenschmidt
2014-02-23 22:26 ` Benjamin Herrenschmidt
2014-02-24 7:56 ` Gavin Shan
2014-02-24 11:32 ` Thomas Gleixner
2014-02-24 11:32 ` Thomas Gleixner
2014-03-04 16:40 ` [tip:irq/core] powerpc: Eeh: " tip-bot for Thomas Gleixner
2014-03-04 16:40 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 04/26] xtensa: Use irq_set_affinity instead of homebrewn code Thomas Gleixner
2014-02-24 0:32 ` Max Filippov
2014-03-04 16:43 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 05/26] sh: " Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:43 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:43 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 06/26] metag: " Thomas Gleixner
[not found] ` <20140223212736.887575774-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2014-02-24 13:24 ` James Hogan [this message]
2014-02-24 13:24 ` James Hogan
[not found] ` <530B47FD.80608-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-02-24 14:24 ` Thomas Gleixner
2014-02-24 14:24 ` Thomas Gleixner
[not found] ` <alpine.DEB.2.02.1402241432360.21251-3cz04HxQygjZikZi3RtOZ1XZhhPuCNm+@public.gmane.org>
2014-02-25 18:56 ` Thomas Gleixner
2014-02-25 18:56 ` Thomas Gleixner
2014-02-25 21:57 ` James Hogan
2014-02-27 10:59 ` Thomas Gleixner
2014-02-27 10:59 ` Thomas Gleixner
2014-02-23 21:40 ` [patch 07/26] pci: pcie-designware: Remove irq_desc abuse Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:40 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 08/26] arm: Replace various irq_desc accesses Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-24 2:55 ` Shawn Guo
2014-02-24 2:55 ` Shawn Guo
2014-02-24 2:55 ` Shawn Guo
2014-02-26 17:05 ` Tony Lindgren
2014-02-26 17:05 ` Tony Lindgren
2014-03-04 16:40 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-20 15:22 ` [patch 08/26] " Arnd Bergmann
2014-03-20 15:22 ` Arnd Bergmann
2014-03-20 15:22 ` Arnd Bergmann
2014-02-23 21:40 ` [patch 09/26] arm: mmp: Remove pointless fiddling with irq internals Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-23 23:17 ` Uwe Kleine-König
2014-02-23 23:17 ` Uwe Kleine-König
2014-02-24 6:07 ` Chao Xie
2014-02-24 6:07 ` Chao Xie
2014-02-24 6:43 ` Haojian Zhuang
2014-02-24 6:43 ` Haojian Zhuang
2014-02-24 11:31 ` Thomas Gleixner
2014-02-24 11:31 ` Thomas Gleixner
2014-02-27 1:37 ` Chao Xie
2014-02-27 1:37 ` Chao Xie
2014-02-27 2:19 ` Haojian Zhuang
2014-02-27 2:19 ` Haojian Zhuang
2014-02-27 11:28 ` Thomas Gleixner
2014-02-27 11:28 ` Thomas Gleixner
2014-02-24 11:27 ` Thomas Gleixner
2014-02-24 11:27 ` Thomas Gleixner
2014-03-04 16:40 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 10/26] blackfin:Use generic /proc/interrupts implementation Thomas Gleixner
2014-02-26 10:00 ` Steven Miao
2014-02-23 21:40 ` [patch 11/26] genirq: Add a kstat helper to increment irq stats Thomas Gleixner
2014-03-04 16:41 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 12/26] mips: Use the core irq stats function Thomas Gleixner
2014-03-04 16:41 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 13/26] sparc: " Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:41 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 18:57 ` [patch 13/26] " David Miller
2014-03-04 18:57 ` David Miller
2014-02-23 21:40 ` [patch 15/26] x86: xen: " Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-24 14:20 ` [Xen-devel] " David Vrabel
2014-02-24 14:20 ` David Vrabel
2014-03-04 16:41 ` [tip:irq/core] x86: Xen: " tip-bot for Thomas Gleixner
2014-03-04 16:41 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 14/26] mn10300: " Thomas Gleixner
2014-03-04 16:42 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 16/26] s390: cio: " Thomas Gleixner
2014-03-04 16:42 ` [tip:irq/core] s390: Cio: " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 17/26] ia64: " Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-03-04 16:42 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:42 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 18/26] xen: Use the proper irq functions Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-24 14:24 ` David Vrabel
2014-02-24 14:24 ` [Xen-devel] " David Vrabel
2014-02-24 21:13 ` Thomas Gleixner
2014-02-24 21:13 ` [Xen-devel] " Thomas Gleixner
2014-03-04 16:40 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:40 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 20/26] genirq: Provide irq_is_allocated() Thomas Gleixner
2014-02-23 21:40 ` [patch 19/26] genirq: Provide irqd_irq_has_actions() Thomas Gleixner
2014-02-23 21:40 ` [patch 21/26] xen: Get rid of the last irq_desc abuse Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-24 14:33 ` [Xen-devel] " David Vrabel
2014-02-24 21:12 ` Thomas Gleixner
2014-02-24 21:12 ` Thomas Gleixner
2014-02-24 14:33 ` David Vrabel
2014-03-04 16:41 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:41 ` tip-bot for Thomas Gleixner
2014-03-04 17:16 ` [Xen-devel] " David Vrabel
2014-03-04 17:16 ` David Vrabel
2014-02-23 21:40 ` [patch 22/26] x86: Add proper vector accounting for HyperV Thomas Gleixner
2014-02-25 12:24 ` KY Srinivasan
2014-03-04 16:42 ` [tip:irq/core] x86: Add proper vector accounting for HYPERVISOR_CALLBACK_VECTOR tip-bot for Thomas Gleixner
2014-09-22 21:03 ` [patch 22/26] x86: Add proper vector accounting for HyperV Elliott, Robert (Server Storage)
2014-02-23 21:40 ` [patch 24/26] genirq: Provide handle_percpu_simple_irq() Thomas Gleixner
2014-02-25 12:25 ` KY Srinivasan
2014-02-23 21:40 ` [patch 23/26] xen: Add proper irq accounting for HYPERCALL vector Thomas Gleixner
2014-02-23 21:40 ` Thomas Gleixner
2014-02-24 14:48 ` [Xen-devel] " David Vrabel
2014-02-24 14:48 ` David Vrabel
2014-03-04 16:42 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:42 ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 25/26] x86: hyperv: Cleanup the irq mess Thomas Gleixner
2014-02-25 12:24 ` KY Srinivasan
2014-02-25 19:10 ` Thomas Gleixner
2014-02-28 2:50 ` KY Srinivasan
2014-03-04 16:42 ` [tip:irq/core] x86: Hyperv: " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 26/26] genirq: Move kstats_inc_irqs_this_cpu() to core Thomas Gleixner
2014-03-04 16:43 ` [tip:irq/core] genirq: Move kstat_incr_irqs_this_cpu() " tip-bot for Thomas Gleixner
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=530B47FD.80608@imgtec.com \
--to=james.hogan-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-X9Un+BFzKDI@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.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.