Skip to content

Commit

Permalink
x86/vector: Store the single CPU targets in apic data
Browse files Browse the repository at this point in the history
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 <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Yu Chen <yu.c.chen@intel.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213154.544867277@linutronix.de
  • Loading branch information
Thomas Gleixner committed Sep 25, 2017
1 parent 86ba655 commit 029c6e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/kernel/apic/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -214,6 +216,7 @@ static int __assign_irq_vector(int irq, struct apic_chip_data *d,
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:
Expand All @@ -228,6 +231,7 @@ static int __assign_irq_vector(int irq, struct apic_chip_data *d,
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;
}

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 029c6e1

Please sign in to comment.