Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670116 > unrolled thread

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

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-06-20 02:20 +0200
Last post2017-06-20 11:30 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [patch 00/55] genirq: Debuggability,  consolidation and managed affinities Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:20 +0200
    [patch 01/55] x86/apic: Add name to irq chip Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:20 +0200
      [tip:irq/core] x86/apic: Add name to irq chip tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-06-22 18:50 +0200
    [patch 04/55] genirq/msi: Prevent overwriting domain name Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:20 +0200
      [tip:irq/core] genirq/msi: Prevent overwriting domain name tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-06-22 18:50 +0200
    Re: [patch 00/55] genirq: Debuggability, consolidation and managed         affinities Christoph Hellwig <hch@lst.de> - 2017-06-20 11:30 +0200

#1670116 — [patch 00/55] genirq: Debuggability, consolidation and managed affinities

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-20 02:20 +0200
Subject[patch 00/55] genirq: Debuggability, consolidation and managed affinities
Message-ID<tUeKl-Xe-5@gated-at.bofh.it>
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/20170603140403.27379-1-hch@lst.de

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

[toc] | [next] | [standalone]


#1670117 — [patch 01/55] x86/apic: Add name to irq chip

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-20 02:20 +0200
Subject[patch 01/55] x86/apic: Add name to irq chip
Message-ID<tUf3I-1jp-37@gated-at.bofh.it>
In reply to#1670116
Add the missing name, so debugging will work proper.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/vector.c |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -534,6 +534,7 @@ static int apic_set_affinity(struct irq_
 }
 
 static struct irq_chip lapic_controller = {
+	.name			= "APIC",
 	.irq_ack		= apic_ack_edge,
 	.irq_set_affinity	= apic_set_affinity,
 	.irq_retrigger		= apic_retrigger_irq,

[toc] | [prev] | [next] | [standalone]


#1672816 — [tip:irq/core] x86/apic: Add name to irq chip

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-06-22 18:50 +0200
Subject[tip:irq/core] x86/apic: Add name to irq chip
Message-ID<tVdsT-7hT-31@gated-at.bofh.it>
In reply to#1670117
Commit-ID:  8947dfb257eb91d7487e06b7d2a069d82e7c19a2
Gitweb:     http://git.kernel.org/tip/8947dfb257eb91d7487e06b7d2a069d82e7c19a2
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 20 Jun 2017 01:37:01 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jun 2017 18:21:06 +0200

x86/apic: Add name to irq chip

Add the missing name, so debugging will work proper.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235443.266561988@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/apic/vector.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index f3557a1..6b21b9e 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -534,6 +534,7 @@ static int apic_set_affinity(struct irq_data *irq_data,
 }
 
 static struct irq_chip lapic_controller = {
+	.name			= "APIC",
 	.irq_ack		= apic_ack_edge,
 	.irq_set_affinity	= apic_set_affinity,
 	.irq_retrigger		= apic_retrigger_irq,

[toc] | [prev] | [next] | [standalone]


#1670118 — [patch 04/55] genirq/msi: Prevent overwriting domain name

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-20 02:20 +0200
Subject[patch 04/55] genirq/msi: Prevent overwriting domain name
Message-ID<tUf3I-1jp-35@gated-at.bofh.it>
In reply to#1670116
Prevent overwriting an already assigned domain name. Remove the extra check
for chip->name, because if domain->name is NULL overwriting it with NULL is
not a problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/msi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -274,7 +274,8 @@ struct irq_domain *msi_create_irq_domain
 
 	domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
 					     fwnode, &msi_domain_ops, info);
-	if (domain && info->chip && info->chip->name)
+
+	if (domain && !domain->name && info->chip)
 		domain->name = info->chip->name;
 
 	return domain;

[toc] | [prev] | [next] | [standalone]


#1672821 — [tip:irq/core] genirq/msi: Prevent overwriting domain name

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-06-22 18:50 +0200
Subject[tip:irq/core] genirq/msi: Prevent overwriting domain name
Message-ID<tVdsT-7hT-43@gated-at.bofh.it>
In reply to#1670118
Commit-ID:  0165308a2f994939d2e1b36624f5a8f57746bc88
Gitweb:     http://git.kernel.org/tip/0165308a2f994939d2e1b36624f5a8f57746bc88
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 20 Jun 2017 01:37:04 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jun 2017 18:21:08 +0200

genirq/msi: Prevent overwriting domain name

Prevent overwriting an already assigned domain name. Remove the extra check
for chip->name, because if domain->name is NULL overwriting it with NULL is
not a problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235443.510684976@linutronix.de

---
 kernel/irq/msi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index fe4d48e..9e3f185 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -274,7 +274,8 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
 
 	domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
 					     fwnode, &msi_domain_ops, info);
-	if (domain && info->chip && info->chip->name)
+
+	if (domain && !domain->name && info->chip)
 		domain->name = info->chip->name;
 
 	return domain;

[toc] | [prev] | [next] | [standalone]


#1670520 — Re: [patch 00/55] genirq: Debuggability, consolidation and managed affinities

FromChristoph Hellwig <hch@lst.de>
Date2017-06-20 11:30 +0200
SubjectRe: [patch 00/55] genirq: Debuggability, consolidation and managed affinities
Message-ID<tUnDX-6Ll-5@gated-at.bofh.it>
In reply to#1670116
On Tue, Jun 20, 2017 at 01:37:00AM +0200, Thomas Gleixner wrote:
> 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/20170603140403.27379-1-hch@lst.de

FYI, this seems to work fine for me with the additional block patches
from that series applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web