diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2009-10-26 18:24:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-02 09:56:35 -0500 |
commit | 23359a88e7eca3c4f402562b102f23014db3c2aa (patch) | |
tree | ffdaa4390c466aac5f3be08115be68276f4ec23d /arch/x86/kernel/apic | |
parent | 84e21493a3b28c9fefe99fe827fc0c0c101a813d (diff) |
x86: Remove move_cleanup_count from irq_cfg
move_cleanup_count for each irq in irq_cfg is keeping track of
the total number of cpus that need to free the corresponding
vectors associated with the irq which has now been migrated to
new destination. As long as this move_cleanup_count is non-zero
(i.e., as long as we have n't freed the vector allocations on
the old destinations) we were preventing the irq's further
migration.
This cleanup count is unnecessary and it is enough to not allow
the irq migration till we send the cleanup vector to the
previous irq destination, for which we already have irq_cfg's
move_in_progress. All we need to make sure is that we free the
vector at the old desintation but we don't need to wait till
that gets freed.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Gary Hade <garyhade@us.ibm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
LKML-Reference: <20091026230001.752968906@sbs-t61.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index ce16b65cfdcc..e9e5b02c3af2 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1161,7 +1161,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask) | |||
1161 | int cpu, err; | 1161 | int cpu, err; |
1162 | cpumask_var_t tmp_mask; | 1162 | cpumask_var_t tmp_mask; |
1163 | 1163 | ||
1164 | if ((cfg->move_in_progress) || cfg->move_cleanup_count) | 1164 | if (cfg->move_in_progress) |
1165 | return -EBUSY; | 1165 | return -EBUSY; |
1166 | 1166 | ||
1167 | if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC)) | 1167 | if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC)) |
@@ -2234,14 +2234,10 @@ void send_cleanup_vector(struct irq_cfg *cfg) | |||
2234 | 2234 | ||
2235 | if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) { | 2235 | if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) { |
2236 | unsigned int i; | 2236 | unsigned int i; |
2237 | cfg->move_cleanup_count = 0; | ||
2238 | for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) | ||
2239 | cfg->move_cleanup_count++; | ||
2240 | for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) | 2237 | for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) |
2241 | apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); | 2238 | apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); |
2242 | } else { | 2239 | } else { |
2243 | cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); | 2240 | cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); |
2244 | cfg->move_cleanup_count = cpumask_weight(cleanup_mask); | ||
2245 | apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); | 2241 | apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); |
2246 | free_cpumask_var(cleanup_mask); | 2242 | free_cpumask_var(cleanup_mask); |
2247 | } | 2243 | } |
@@ -2430,8 +2426,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void) | |||
2430 | 2426 | ||
2431 | cfg = irq_cfg(irq); | 2427 | cfg = irq_cfg(irq); |
2432 | spin_lock(&desc->lock); | 2428 | spin_lock(&desc->lock); |
2433 | if (!cfg->move_cleanup_count) | ||
2434 | goto unlock; | ||
2435 | 2429 | ||
2436 | if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) | 2430 | if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) |
2437 | goto unlock; | 2431 | goto unlock; |
@@ -2449,7 +2443,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void) | |||
2449 | goto unlock; | 2443 | goto unlock; |
2450 | } | 2444 | } |
2451 | __get_cpu_var(vector_irq)[vector] = -1; | 2445 | __get_cpu_var(vector_irq)[vector] = -1; |
2452 | cfg->move_cleanup_count--; | ||
2453 | unlock: | 2446 | unlock: |
2454 | spin_unlock(&desc->lock); | 2447 | spin_unlock(&desc->lock); |
2455 | } | 2448 | } |