Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcef5911 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar
Browse files

x86/irq: remove leftover code from NUMA_MIGRATE_IRQ_DESC



The original feature of migrating irq_desc dynamic was too fragile
and was causing problems: it caused crashes on systems with lots of
cards with MSI-X when user-space irq-balancer was enabled.

We now have new patches that create irq_desc according to device
numa node. This patch removes the leftover bits of the dynamic balancer.

[ Impact: remove dead code ]

Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <49F654AF.8000808@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9ec4fa27
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -274,16 +274,6 @@ config SPARSE_IRQ

	  If you don't know what to do here, say N.

config NUMA_MIGRATE_IRQ_DESC
	bool "Move irq desc when changing irq smp_affinity"
	depends on SPARSE_IRQ && NUMA
	depends on BROKEN
	default n
	---help---
	  This enables moving irq_desc to cpu/node that irq will use handled.

	  If you don't know what to do here, say N.

config X86_MPPARSE
	bool "Enable MPS table" if ACPI
	default y
+0 −1
Original line number Diff line number Diff line
@@ -195,7 +195,6 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP=y
CONFIG_SPARSE_IRQ=y
# CONFIG_NUMA_MIGRATE_IRQ_DESC is not set
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y
# CONFIG_X86_ELAN is not set
+4 −52
Original line number Diff line number Diff line
@@ -148,9 +148,6 @@ struct irq_cfg {
	unsigned move_cleanup_count;
	u8 vector;
	u8 move_in_progress : 1;
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
	u8 move_desc_pending : 1;
#endif
};

/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
@@ -254,8 +251,7 @@ int arch_init_chip_data(struct irq_desc *desc, int cpu)
	return 0;
}

#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC

/* for move_irq_desc */
static void
init_copy_irq_2_pin(struct irq_cfg *old_cfg, struct irq_cfg *cfg, int cpu)
{
@@ -356,19 +352,7 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
		old_desc->chip_data = NULL;
	}
}

static void
set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
{
	struct irq_cfg *cfg = desc->chip_data;

	if (!cfg->move_in_progress) {
		/* it means that domain is not changed */
		if (!cpumask_intersects(desc->affinity, mask))
			cfg->move_desc_pending = 1;
	}
}
#endif
/* end for move_irq_desc */

#else
static struct irq_cfg *irq_cfg(unsigned int irq)
@@ -378,13 +362,6 @@ static struct irq_cfg *irq_cfg(unsigned int irq)

#endif

#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC
static inline void
set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
{
}
#endif

struct io_apic {
	unsigned int index;
	unsigned int unused[3];
@@ -592,9 +569,6 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
	if (assign_irq_vector(irq, cfg, mask))
		return BAD_APICID;

	/* check that before desc->addinity get updated */
	set_extra_move_desc(desc, mask);

	cpumask_copy(desc->affinity, mask);

	return apic->cpu_mask_to_apicid_and(desc->affinity, cfg->domain);
@@ -2393,8 +2367,6 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
	if (assign_irq_vector(irq, cfg, mask))
		return;

	set_extra_move_desc(desc, mask);

	dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask);

	irte.vector = cfg->vector;
@@ -2491,35 +2463,15 @@ static void irq_complete_move(struct irq_desc **descp)
	struct irq_cfg *cfg = desc->chip_data;
	unsigned vector, me;

	if (likely(!cfg->move_in_progress)) {
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
		if (likely(!cfg->move_desc_pending))
			return;

		/* domain has not changed, but affinity did */
		me = smp_processor_id();
		if (cpumask_test_cpu(me, desc->affinity)) {
			*descp = desc = move_irq_desc(desc, me);
			/* get the new one */
			cfg = desc->chip_data;
			cfg->move_desc_pending = 0;
		}
#endif
	if (likely(!cfg->move_in_progress))
		return;
	}

	vector = ~get_irq_regs()->orig_ax;
	me = smp_processor_id();

	if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) {
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
		*descp = desc = move_irq_desc(desc, me);
		/* get the new one */
		cfg = desc->chip_data;
#endif
	if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
		send_cleanup_vector(cfg);
}
}
#else
static inline void irq_complete_move(struct irq_desc **descp) {}
#endif
+0 −10
Original line number Diff line number Diff line
@@ -212,16 +212,6 @@ extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);

extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);

static inline struct irq_desc *
irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
{
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
	return irq_to_desc(irq);
#else
	return desc;
#endif
}

/*
 * Migration helpers for obsolete names, they will go away:
 */
+1 −1
Original line number Diff line number Diff line
@@ -3,5 +3,5 @@ obj-y := handle.o manage.o spurious.o resend.o chip.o devres.o
obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
obj-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o
obj-$(CONFIG_NUMA_MIGRATE_IRQ_DESC) += numa_migrate.o
obj-$(CONFIG_SPARSE_IRQ) += numa_migrate.o
obj-$(CONFIG_PM_SLEEP) += pm.o
Loading