Skip to content

Commit fcef591

Browse files
Yinghai LuIngo Molnar
authored andcommitted
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: Yinghai 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: Ingo Molnar <mingo@elte.hu>
1 parent 9ec4fa2 commit fcef591

8 files changed

Lines changed: 9 additions & 93 deletions

File tree

‎arch/x86/Kconfig‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,6 @@ config SPARSE_IRQ
274274

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

277-
config NUMA_MIGRATE_IRQ_DESC
278-
bool "Move irq desc when changing irq smp_affinity"
279-
depends on SPARSE_IRQ && NUMA
280-
depends on BROKEN
281-
default n
282-
---help---
283-
This enables moving irq_desc to cpu/node that irq will use handled.
284-
285-
If you don't know what to do here, say N.
286-
287277
config X86_MPPARSE
288278
bool "Enable MPS table" if ACPI
289279
default y

‎arch/x86/configs/x86_64_defconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ CONFIG_HIGH_RES_TIMERS=y
195195
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
196196
CONFIG_SMP=y
197197
CONFIG_SPARSE_IRQ=y
198-
# CONFIG_NUMA_MIGRATE_IRQ_DESC is not set
199198
CONFIG_X86_FIND_SMP_CONFIG=y
200199
CONFIG_X86_MPPARSE=y
201200
# CONFIG_X86_ELAN is not set

‎arch/x86/kernel/apic/io_apic.c‎

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ struct irq_cfg {
148148
unsigned move_cleanup_count;
149149
u8 vector;
150150
u8 move_in_progress : 1;
151-
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
152-
u8 move_desc_pending : 1;
153-
#endif
154151
};
155152

156153
/* 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)
254251
return 0;
255252
}
256253

257-
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
258-
254+
/* for move_irq_desc */
259255
static void
260256
init_copy_irq_2_pin(struct irq_cfg *old_cfg, struct irq_cfg *cfg, int cpu)
261257
{
@@ -356,19 +352,7 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
356352
old_desc->chip_data = NULL;
357353
}
358354
}
359-
360-
static void
361-
set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
362-
{
363-
struct irq_cfg *cfg = desc->chip_data;
364-
365-
if (!cfg->move_in_progress) {
366-
/* it means that domain is not changed */
367-
if (!cpumask_intersects(desc->affinity, mask))
368-
cfg->move_desc_pending = 1;
369-
}
370-
}
371-
#endif
355+
/* end for move_irq_desc */
372356

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

379363
#endif
380364

381-
#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC
382-
static inline void
383-
set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
384-
{
385-
}
386-
#endif
387-
388365
struct io_apic {
389366
unsigned int index;
390367
unsigned int unused[3];
@@ -592,9 +569,6 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
592569
if (assign_irq_vector(irq, cfg, mask))
593570
return BAD_APICID;
594571

595-
/* check that before desc->addinity get updated */
596-
set_extra_move_desc(desc, mask);
597-
598572
cpumask_copy(desc->affinity, mask);
599573

600574
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)
23932367
if (assign_irq_vector(irq, cfg, mask))
23942368
return;
23952369

2396-
set_extra_move_desc(desc, mask);
2397-
23982370
dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask);
23992371

24002372
irte.vector = cfg->vector;
@@ -2491,34 +2463,14 @@ static void irq_complete_move(struct irq_desc **descp)
24912463
struct irq_cfg *cfg = desc->chip_data;
24922464
unsigned vector, me;
24932465

2494-
if (likely(!cfg->move_in_progress)) {
2495-
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
2496-
if (likely(!cfg->move_desc_pending))
2497-
return;
2498-
2499-
/* domain has not changed, but affinity did */
2500-
me = smp_processor_id();
2501-
if (cpumask_test_cpu(me, desc->affinity)) {
2502-
*descp = desc = move_irq_desc(desc, me);
2503-
/* get the new one */
2504-
cfg = desc->chip_data;
2505-
cfg->move_desc_pending = 0;
2506-
}
2507-
#endif
2466+
if (likely(!cfg->move_in_progress))
25082467
return;
2509-
}
25102468

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

2514-
if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) {
2515-
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
2516-
*descp = desc = move_irq_desc(desc, me);
2517-
/* get the new one */
2518-
cfg = desc->chip_data;
2519-
#endif
2472+
if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
25202473
send_cleanup_vector(cfg);
2521-
}
25222474
}
25232475
#else
25242476
static inline void irq_complete_move(struct irq_desc **descp) {}

‎include/linux/irq.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
212212

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

215-
static inline struct irq_desc *
216-
irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
217-
{
218-
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
219-
return irq_to_desc(irq);
220-
#else
221-
return desc;
222-
#endif
223-
}
224-
225215
/*
226216
* Migration helpers for obsolete names, they will go away:
227217
*/

‎kernel/irq/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ obj-y := handle.o manage.o spurious.o resend.o chip.o devres.o
33
obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
44
obj-$(CONFIG_PROC_FS) += proc.o
55
obj-$(CONFIG_GENERIC_PENDING_IRQ) += migration.o
6-
obj-$(CONFIG_NUMA_MIGRATE_IRQ_DESC) += numa_migrate.o
6+
obj-$(CONFIG_SPARSE_IRQ) += numa_migrate.o
77
obj-$(CONFIG_PM_SLEEP) += pm.o

‎kernel/irq/chip.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
359359

360360
spin_lock(&desc->lock);
361361
mask_ack_irq(desc, irq);
362-
desc = irq_remap_to_desc(irq, desc);
363362

364363
if (unlikely(desc->status & IRQ_INPROGRESS))
365364
goto out_unlock;
@@ -438,7 +437,6 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
438437
desc->status &= ~IRQ_INPROGRESS;
439438
out:
440439
desc->chip->eoi(irq);
441-
desc = irq_remap_to_desc(irq, desc);
442440

443441
spin_unlock(&desc->lock);
444442
}
@@ -475,15 +473,13 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
475473
!desc->action)) {
476474
desc->status |= (IRQ_PENDING | IRQ_MASKED);
477475
mask_ack_irq(desc, irq);
478-
desc = irq_remap_to_desc(irq, desc);
479476
goto out_unlock;
480477
}
481478
kstat_incr_irqs_this_cpu(irq, desc);
482479

483480
/* Start handling the irq */
484481
if (desc->chip->ack)
485482
desc->chip->ack(irq);
486-
desc = irq_remap_to_desc(irq, desc);
487483

488484
/* Mark the IRQ currently in progress.*/
489485
desc->status |= IRQ_INPROGRESS;
@@ -544,10 +540,8 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
544540
if (!noirqdebug)
545541
note_interrupt(irq, desc, action_ret);
546542

547-
if (desc->chip->eoi) {
543+
if (desc->chip->eoi)
548544
desc->chip->eoi(irq);
549-
desc = irq_remap_to_desc(irq, desc);
550-
}
551545
}
552546

553547
void
@@ -582,10 +576,8 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
582576

583577
/* Uninstall? */
584578
if (handle == handle_bad_irq) {
585-
if (desc->chip != &no_irq_chip) {
579+
if (desc->chip != &no_irq_chip)
586580
mask_ack_irq(desc, irq);
587-
desc = irq_remap_to_desc(irq, desc);
588-
}
589581
desc->status |= IRQ_DISABLED;
590582
desc->depth = 1;
591583
}

‎kernel/irq/handle.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,8 @@ unsigned int __do_IRQ(unsigned int irq)
458458
/*
459459
* No locking required for CPU-local interrupts:
460460
*/
461-
if (desc->chip->ack) {
461+
if (desc->chip->ack)
462462
desc->chip->ack(irq);
463-
/* get new one */
464-
desc = irq_remap_to_desc(irq, desc);
465-
}
466463
if (likely(!(desc->status & IRQ_DISABLED))) {
467464
action_ret = handle_IRQ_event(irq, desc->action);
468465
if (!noirqdebug)
@@ -473,10 +470,8 @@ unsigned int __do_IRQ(unsigned int irq)
473470
}
474471

475472
spin_lock(&desc->lock);
476-
if (desc->chip->ack) {
473+
if (desc->chip->ack)
477474
desc->chip->ack(irq);
478-
desc = irq_remap_to_desc(irq, desc);
479-
}
480475
/*
481476
* REPLAY is when Linux resends an IRQ that was dropped earlier
482477
* WAITING is used by probe to mark irqs that are being tested

‎kernel/irq/numa_migrate.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
9797

9898
/* free the old one */
9999
free_one_irq_desc(old_desc, desc);
100-
spin_unlock(&old_desc->lock);
101100
kfree(old_desc);
102-
spin_lock(&desc->lock);
103101

104102
return desc;
105103

0 commit comments

Comments
 (0)