linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/3] arm/arm64: fix a migrating irq bug when hotplug cpu
@ 2015-09-14  9:29 Yang Yingliang
  2015-09-14  9:29 ` [RFC PATCH v2 1/3] irqchip: GICv3: set non-percpu irqs status with IRQ_MOVE_PCNTXT Yang Yingliang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yang Yingliang @ 2015-09-14  9:29 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: Yang Yingliang, Jiang Liu, Thomas Gleixner, Marc Zyngier,
	Mark Rutland, Will Deacon, Russell King - ARM Linux

Hi All,

There is a bug:

When cpu is disabled, all irqs will be migratged to another cpu.
In some cases, a new affinity is different, it needed to be coppied
to irq's affinity. But if the type of irq is LPI, it's affinity will
not be coppied because of irq_set_affinity's return value.



As Marc and Will suggested, I refactor the arm/arm64 migrating interrupts
code and fix the migrating irq bug while cpu is offline.

I'm trying let the core code do the migrating interrupts matter. kernel/irq/migration.c
depends on CONFIG_GENERIC_PENDING_IRQ, so I make it selected by CONFIG_SMP and
CONFIG_HOTPLUG_CPU and rename it to CONFIG_GENERIC_IRQ_MIGRATION for more general.
When CONFIG_GENERIC_IRQ_MIGRATION is enabled, an interrupt whose state_use_accessors
is not set with IRQD_MOVE_PCNTXT won't be migrated immediately in irq_set_affinity_locked().
So use irq_set_status_flags() helper to set the state in gic_irq_domain_map().

With the above preparation, move the migrating interrupts code into kernel/irq/migration.c
and fix the bug by using irq_do_set_affinity().

Changes in v2:
 - use the exiting helper to set IRQD_MOVE_PCNTXT flag
 - use for_each_active_irq() instead of for_each_irq_desc()
 - add some warn messages when affinity is null or do set affinity failed

Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>


Yang Yingliang (3):
  irqchip: GICv3: set non-percpu irqs status with IRQ_MOVE_PCNTXT
  genirq: rename config GENERIC_PENDING_IRQ to GENERIC_IRQ_MIGRATION
  arm/arm64: fix a migrating irq bug when hotplug cpu

 arch/arc/Kconfig               |  2 +-
 arch/arm/Kconfig               |  1 +
 arch/arm/include/asm/irq.h     |  1 -
 arch/arm/kernel/irq.c          | 62 ---------------------------------------
 arch/arm64/Kconfig             |  1 +
 arch/arm64/include/asm/irq.h   |  1 -
 arch/arm64/kernel/irq.c        | 62 ---------------------------------------
 arch/hexagon/Kconfig           |  2 +-
 arch/ia64/Kconfig              |  2 +-
 arch/tile/Kconfig              |  2 +-
 arch/x86/Kconfig               |  2 +-
 arch/x86/kernel/apic/io_apic.c |  2 +-
 drivers/irqchip/irq-gic-v3.c   |  2 ++
 include/linux/irq.h            |  4 ++-
 include/linux/irqdesc.h        |  2 +-
 kernel/irq/Kconfig             |  4 +--
 kernel/irq/Makefile            |  2 +-
 kernel/irq/irqdesc.c           |  6 ++--
 kernel/irq/manage.c            |  2 +-
 kernel/irq/migration.c         | 66 ++++++++++++++++++++++++++++++++++++++++++
 kernel/irq/proc.c              |  2 +-
 21 files changed, 88 insertions(+), 142 deletions(-)

-- 
2.5.0



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

end of thread, other threads:[~2015-09-15  3:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14  9:29 [RFC PATCH v2 0/3] arm/arm64: fix a migrating irq bug when hotplug cpu Yang Yingliang
2015-09-14  9:29 ` [RFC PATCH v2 1/3] irqchip: GICv3: set non-percpu irqs status with IRQ_MOVE_PCNTXT Yang Yingliang
2015-09-14 12:50   ` Marc Zyngier
2015-09-15  3:07     ` Yang Yingliang
2015-09-14  9:29 ` [RFC PATCH v2 2/3] genirq: rename config GENERIC_PENDING_IRQ to GENERIC_IRQ_MIGRATION Yang Yingliang
2015-09-14  9:29 ` [RFC PATCH v2 3/3] arm/arm64: fix a migrating irq bug when hotplug cpu Yang Yingliang

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).