From: Thomas Gleixner Date: Wed, 13 Sep 2017 21:29:31 +0000 (+0200) Subject: x86/vector: Store the single CPU targets in apic data X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~6588^2~33 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=029c6e1c9df776fe1b2ba756a28fb65e9f9e9f69;p=mirror_ubuntu-focal-kernel.git x86/vector: Store the single CPU targets in apic data Now that the interrupt affinities are targeted at single CPUs storing them in a cpumask is overkill. Store them in a dedicated variable. This does not yet remove the domain cpumasks because the current allocator relies on them. Preparatory change for the allocator rework. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Yu Chen Acked-by: Juergen Gross Cc: Boris Ostrovsky Cc: Tony Luck Cc: Marc Zyngier Cc: Alok Kataria Cc: Joerg Roedel Cc: "Rafael J. Wysocki" Cc: Steven Rostedt Cc: Christoph Hellwig Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Rui Zhang Cc: "K. Y. Srinivasan" Cc: Arjan van de Ven Cc: Dan Williams Cc: Len Brown Link: https://lkml.kernel.org/r/20170913213154.544867277@linutronix.de --- diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index a7f7c3730a09..7a9e0c6dd756 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -23,6 +23,8 @@ struct apic_chip_data { struct irq_cfg cfg; + unsigned int cpu; + unsigned int prev_cpu; cpumask_var_t domain; cpumask_var_t old_domain; u8 move_in_progress : 1; @@ -214,6 +216,7 @@ update: cpumask_and(d->old_domain, d->old_domain, cpu_online_mask); d->move_in_progress = !cpumask_empty(d->old_domain); d->cfg.old_vector = d->move_in_progress ? d->cfg.vector : 0; + d->prev_cpu = d->cpu; d->cfg.vector = vector; cpumask_copy(d->domain, vector_cpumask); success: @@ -228,6 +231,7 @@ success: cpumask_and(vector_searchmask, vector_searchmask, mask); BUG_ON(apic->cpu_mask_to_apicid(vector_searchmask, irqd, &d->cfg.dest_apicid)); + d->cpu = cpumask_first(vector_searchmask); return 0; } @@ -428,6 +432,7 @@ static void __init init_legacy_irqs(void) apicd->cfg.vector = ISA_IRQ_VECTOR(i); cpumask_copy(apicd->domain, cpumask_of(0)); + apicd->cpu = 0; irq_set_chip_data(i, apicd); } }