Skip to content

genirq: Debuggability, consolidation and managed affinities

Thomas Gleixner linux-block linux-iommu linux-nvme linux-pci lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest55 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/55x86/apic: Add name to irq chiparch/x86/kernel/apic/vector.c+1 -00 replies
2/55iommu/amd: Add name to irq chipdrivers/iommu/amd_iommu.c+5 -41 reply
3/55iommu/vt-d: Add name to irq chipdrivers/iommu/intel_irq_remapping.c+5 -41 reply
4/55genirq/msi: Prevent overwriting domain namekernel/irq/msi.c+2 -10 replies
5/55genirq: Allow fwnode to carry name information onlyinclude/linux/irqdomain.h kernel/irq/irqdomain.c+100 -140 replies
6/55x86/vector: Create named irq domainarch/x86/kernel/apic/vector.c+7 -20 replies
7/55x86/ioapic: Create named irq domainarch/x86/kernel/apic/io_apic.c+20 -20 replies
8/55x86/htirq: Create named domainarch/x86/kernel/apic/htirq.c+16 -50 replies
9/55x86/uv: Create named irq domainarch/x86/platform/uv/uv_irq.c+13 -50 replies
10/55x86/msi: Provide new iommu irqdomain interfacearch/x86/include/asm/irq_remapping.h arch/x86/kernel/apic/msi.c+17 -00 replies
11/55iommu/vt-d: Use named irq domain interfacedrivers/iommu/intel_irq_remapping.c+16 -61 reply
12/55iommu/amd: Use named irq domain interfacedrivers/iommu/amd_iommu.c+10 -31 reply
13/55x86/msi: Remove unused remap irq domain interfacearch/x86/include/asm/irq_remapping.h arch/x86/kernel/apic/msi.c+0 -70 replies
14/55x86/msi: Create named irq domainsarch/x86/kernel/apic/msi.c+33 -90 replies
15/55PCI: vmd: Create named irq domaindrivers/pci/host/vmd.c+7 -13 replies
16/55genirq/irqdomain: Add map counterinclude/linux/irqdomain.h kernel/irq/irqdomain.c+6 -00 replies
17/55genirq/debugfs: Add proper debugfs interfaceinclude/linux/irqdesc.h include/linux/irqdomain.h kernel/irq/Kconfig +6 more+345 -10 replies
18/55genirq: Add missing comment for IRQD_STARTEDinclude/linux/irq.h+1 -00 replies
19/55genirq: Provide irq_fixup_move_pending()include/linux/irq.h kernel/irq/migration.c+35 -02 replies
20/55x86/irq: Cleanup pending irq move in fixup_irqs()arch/x86/kernel/irq.c+21 -40 replies
21/55genirq: Remove mask argument from setup_affinity()kernel/irq/internals.h kernel/irq/manage.c kernel/irq/proc.c+29 -340 replies
22/55genirq: Rename setup_affinity() to irq_setup_affinity()kernel/irq/internals.h kernel/irq/manage.c+7 -60 replies
23/55genirq: Move initial affinity setup to irq_startup()kernel/irq/chip.c kernel/irq/manage.c+8 -90 replies
24/55genirq: Move pending helpers to internal.hkernel/irq/internals.h kernel/irq/manage.c+38 -280 replies
25/55genirq/cpuhotplug: Remove irq disabling logickernel/irq/cpuhotplug.c+4 -80 replies
26/55genirq/cpuhotplug: Dont claim success on errorkernel/irq/cpuhotplug.c+4 -10 replies
27/55genirq/cpuhotplug: Reorder check logickernel/irq/cpuhotplug.c+20 -160 replies
28/55genirq/cpuhotplug: Do not migrated shutdown irqskernel/irq/cpuhotplug.c+8 -30 replies
29/55genirq/cpuhotplug: Add support for cleaning up move in progressarch/x86/include/asm/irq.h include/linux/irq.h kernel/irq/cpuhotplug.c +1 more+37 -40 replies
30/55genirq/cpuhotplug: Add support for conditional maskingkernel/irq/cpuhotplug.c+10 -10 replies
31/55genirq/cpuhotplug: Set force affinity flag on hotplug migrationkernel/irq/cpuhotplug.c+1 -10 replies
32/55x86/irq: Restructure fixup_irqs()arch/x86/kernel/irq.c+20 -262 replies
33/55x86/irq: Use irq_migrate_all_off_this_cpu()arch/x86/Kconfig arch/x86/kernel/irq.c+3 -870 replies
34/55genirq: Move irq_fixup_move_pending() to coreinclude/linux/irq.h kernel/irq/internals.h+5 -50 replies
35/55genirq: Remove pointless arg from show_irq_affinitykernel/irq/proc.c+3 -30 replies
36/55genirq: Remove pointless gfp argumentkernel/irq/irqdesc.c+7 -80 replies
37/55genirq/proc: Replace ever repeating type castkernel/irq/proc.c+5 -50 replies
38/55genirq: Introduce effective affinity maskinclude/linux/irq.h kernel/irq/Kconfig kernel/irq/debugfs.c +2 more+134 -70 replies
39/55genirq/cpuhotplug: Use effective affinity maskkernel/irq/cpuhotplug.c+11 -30 replies
40/55x86/apic: Move flat_cpu_mask_to_apicid_and() into C sourcearch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c+22 -220 replies
41/55x86/uv: Use default_cpu_mask_to_apicid_and()arch/x86/kernel/apic/x2apic_uv_x.c+4 -150 replies
42/55x86/apic: Move online masking to core codearch/x86/kernel/apic/apic.c arch/x86/kernel/apic/vector.c arch/x86/kernel/apic/x2apic_cluster.c+22 -350 replies
43/55x86/apic: Move cpumask and to core codearch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/apic_flat_64.c +9 more+29 -420 replies
44/55x86/apic: Add irq_data argument to apic->cpu_mask_to_apicid()arch/x86/include/asm/apic.h arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/vector.c +2 more+32 -150 replies
45/55xen/events: Add support for effective affinity maskdrivers/xen/events/events_base.c+5 -10 replies
46/55x86/apic: Implement effective irq mask updatearch/x86/Kconfig arch/x86/kernel/apic/apic.c arch/x86/kernel/apic/x2apic_cluster.c+8 -00 replies
47/55genirq: Introduce IRQD_MANAGED_SHUTDOWNinclude/linux/irq.h kernel/irq/internals.h+18 -00 replies
48/55genirq: Split out irq_startup() codekernel/irq/chip.c+18 -110 replies
49/55genirq: Add force argument to irq_startup()kernel/irq/autoprobe.c kernel/irq/chip.c kernel/irq/internals.h +1 more+14 -70 replies
50/55genirq: Handle managed irqs gracefully in irq_startup()include/linux/irq.h kernel/irq/chip.c+62 -40 replies
51/55genirq/cpuhotplug: Handle managed IRQs on CPU hotpluginclude/linux/cpuhotplug.h include/linux/irq.h kernel/cpu.c +1 more+56 -00 replies
52/55genirq: Introduce IRQD_SINGLE_TARGET flaginclude/linux/irq.h kernel/irq/debugfs.c+17 -00 replies
53/55genirq/cpuhotplug: Avoid irq affinity setting for single targetskernel/irq/cpuhotplug.c+10 -20 replies
54/55x86/apic: Mark single target interruptsarch/x86/kernel/apic/vector.c+7 -00 replies
55/55genirq/affinity: Assign vectors to all present CPUskernel/irq/affinity.c+63 -130 replies

Reviews trailers per patch

4 of 55 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigJoerg Roedel
1/55
2/55A-b
3/55A-b
4/55
5/55
6/55
7/55
8/55
9/55
10/55
11/55A-b
12/55A-b
13/55
14/55
15/55
16/55
17/55
18/55
19/55
20/55
21/55
22/55
23/55
24/55
25/55
26/55
27/55
28/55
29/55
30/55
31/55
32/55
33/55
34/55
35/55
36/55
37/55
38/55
39/55
40/55
41/55
42/55
43/55
44/55
45/55
46/55
47/55
48/55
49/55
50/55
51/55Originally-by
52/55
53/55
54/55
55/55

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 00/55] genirq: Debuggability, consolidation and managed affinities

This started out with 5 patches from Christoph who wanted to add a mechanism for interrupts with managed affinities to spread them over all present CPUs and instead of migrating them, shut them down into managed shutdown state when the last CPU in the affinity set goes offline and then resume them when a CPU to which belongs to the affinity set comes online again. See:

http://lkml.kernel.org/r/[email protected]

After staring at it for a while it became clear that the approach is not sufficient to deal with all the oddities of the x86 interrupt handling.

The mechanism to migrate interrupts inside the affinity set or shut them down when the last CPU of the set goes offline is the same as the general cpu hotplug migration mechanism. x86 does not use yet the generic cpu hotplug irq migration code, so supporting this feature would require changes to both architecture and core code. After staring long enough, I decided to extend the core migration code so it can handle the x86 oddities as well. There are a few subtle changes in that code which might affect the existing users (ARM64/POWERPC), but AFAICT they should not change the behaviour. Please look carefully.

While doing this I stumbled over a bunch of other details, which I addressed in seperate patches. Once again the missing ability to debug all of this turned out to be a major pain. So I hacked a quick debugfs tool, which helped me to sort out the details. I rewrote that proper and it's included in the start of the series. This also required to extend the fwnode so x86 can supply unique domain names on domain creation.

The series applies on

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core

and is also available via git from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.irq

Thanks,

tglx

----

 arch/x86/Kconfig                      |    2 
 arch/x86/include/asm/apic.h           |   36 +----
 arch/x86/include/asm/irq.h            |    1 
 arch/x86/include/asm/irq_remapping.h  |    3 
 arch/x86/kernel/apic/apic.c           |   35 +++--
 arch/x86/kernel/apic/apic_flat_64.c   |    4 
 arch/x86/kernel/apic/apic_noop.c      |    2 
 arch/x86/kernel/apic/apic_numachip.c  |    4 
 arch/x86/kernel/apic/bigsmp_32.c      |    2 
 arch/x86/kernel/apic/htirq.c          |   21 ++-
 arch/x86/kernel/apic/io_apic.c        |   22 +++
 arch/x86/kernel/apic/msi.c            |   55 ++++++--
 arch/x86/kernel/apic/probe_32.c       |    2 
 arch/x86/kernel/apic/vector.c         |   49 +++++--
 arch/x86/kernel/apic/x2apic_cluster.c |   36 ++---
 arch/x86/kernel/apic/x2apic_phys.c    |    2 
 arch/x86/kernel/apic/x2apic_uv_x.c    |   26 +---
 arch/x86/kernel/irq.c                 |   78 ------------
 arch/x86/platform/uv/uv_irq.c         |   18 ++
 arch/x86/xen/apic.c                   |    2 
 drivers/iommu/amd_iommu.c             |   22 ++-
 drivers/iommu/intel_irq_remapping.c   |   31 +++-
 drivers/pci/host/vmd.c                |    8 +
 drivers/xen/events/events_base.c      |    6 
 include/linux/cpuhotplug.h            |    1 
 include/linux/irq.h                   |   61 +++++++++
 include/linux/irqdesc.h               |    4 
 include/linux/irqdomain.h             |   37 +++++
 kernel/cpu.c                          |    5 
 kernel/irq/Kconfig                    |   15 ++
 kernel/irq/Makefile                   |    1 
 kernel/irq/affinity.c                 |   76 +++++++++--
 kernel/irq/autoprobe.c                |    4 
 kernel/irq/chip.c                     |   91 ++++++++++++--
 kernel/irq/cpuhotplug.c               |  150 +++++++++++++++++++----
 kernel/irq/debugfs.c                  |  220 ++++++++++++++++++++++++++++++++++
 kernel/irq/internals.h                |  100 +++++++++++++++
 kernel/irq/irqdesc.c                  |   30 +++-
 kernel/irq/irqdomain.c                |  170 ++++++++++++++++++++++++--
 kernel/irq/manage.c                   |  102 ++++-----------
 kernel/irq/migration.c                |   30 ++++
 kernel/irq/msi.c                      |    3 
 kernel/irq/proc.c                     |  110 ++++++++++++++---
 43 files changed, 1294 insertions(+), 383 deletions(-)