Skip to content

RFC arm/arm64: fix a migrating irq bug when hotplug cpu

Yang Yingliang linux-arm-kernel linux-sh lkml 6 versions – Applied

Status from this message: I applied that to a seperate branch

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 RFC Latest3 patches 13 repliesApplied
  2. v5 RFC4 patches 8 repliesSuperseded
  3. v4 RFC4 patches 7 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 RFC3 patches6 repliesSuperseded
v2 RFC3 patches2 repliesSuperseded
v1 RFC4 patches14 repliesSuperseded

Changes in v6 from the cover letter

- Don't touch the existing file kernel/irq/migration.c and add migrating interrupts code to a new file kernel/irq/cpuhotplug.c suggested by Thomas.
- Change some comments in patch #2 and #3.

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/3genirq: introduce CONFIG_GENERIC_IRQ_MIGRATION and kernel/irq/cpuhotplug.cinclude/linux/irq.h kernel/irq/Kconfig kernel/irq/Makefile +1 more+75 -02 replies
2/3arm64: fix a migrating irq bug when hotplug cpuarch/arm64/Kconfig arch/arm64/include/asm/irq.h arch/arm64/kernel/irq.c +1 more+2 -641 reply
3/3arm: fix a migrating irq bug when hotplug cpuarch/arm/Kconfig arch/arm/include/asm/irq.h arch/arm/kernel/irq.c +1 more+2 -6410 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [RFC PATCH v6 0/3] arm/arm64: fix a migrating irq bug when hotplug cpu

----
Changes in v6:
- Don't touch the existing file kernel/irq/migration.c and add migrating interrupts code to a new file kernel/irq/cpuhotplug.c suggested by Thomas.
- Change some comments in patch #2 and #3.

Changes in v5:
- remove the macro that guard move_irqs()
- use name irq_migrate_all_off_this_cpu instead of move_irqs

Changes in v4:
- select GENERIC_IRQ_MIGRATION when config GENERIC_IRQ_MIGRATION is enabled
- add move_irqs() into kerne/irq/migration.c for cpu hotplug
- use move_irqs() to migrate interrupts on arm/arm64 when cpu is going to down
- split bugfix patch into seperate patches for arm and arm64

Changes in v3:
- introduce config GENERIC_IRQ_MIGRATION for compiling migration.c
- rename migrate_irqs in arch/ia64/kernel/irq.c to avoid compiling error

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

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 before cpu is offline.

I'm trying let the core code do the migrating interrupts matter. Add the migrating code to a new file kernel/irq/cpuhotplug.c and make it depend on GENERIC_IRQ_MIGRATION. Fix the bug by using irq_do_set_affinity. And use the new code to migrate interrupts before cpu is offline on arm and arm64.

Cc Jiang Liu <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Will Deacon <[email protected]>
Cc Russell King - ARM Linux <[email protected]>
Cc Hanjun Guo <[email protected]>

Yang Yingliang (3):
genirq: introduce CONFIG_GENERIC_IRQ_MIGRATION and
kernel/irq/cpuhotplug.c
arm64: fix a migrating irq bug when hotplug cpu
arm: fix a migrating irq bug when hotplug cpu

 arch/arm/Kconfig             |  1 +
 arch/arm/include/asm/irq.h   |  1 -
 arch/arm/kernel/irq.c        | 62 ----------------------------------------
 arch/arm/kernel/smp.c        |  2 +-
 arch/arm64/Kconfig           |  1 +
 arch/arm64/include/asm/irq.h |  1 -
 arch/arm64/kernel/irq.c      | 62 ----------------------------------------
 arch/arm64/kernel/smp.c      |  2 +-
 include/linux/irq.h          |  2 ++
 kernel/irq/Kconfig           |  4 +++
 kernel/irq/Makefile          |  1 +
 kernel/irq/cpuhotplug.c      | 68 ++++++++++++++++++++++++++++++++++++++++++++
 12 files changed, 79 insertions(+), 128 deletions(-)
 create mode 100644 kernel/irq/cpuhotplug.c
Signature · 1 line
2.5.0