Commit 01a8d063 authored by Dave Hansen's avatar Dave Hansen Committed by Oleg Drokin

[PATCH] NUMA-Q disable irqbalance

Here's a patch from Andrea's tree that uses IRQ_BALANCE_INTERVAL to
define how often interrupts are balanced, staying independent from HZ.

  It also makes sure that there _is_ a change to the configuration
before it actually writes it.  It reminds me of the mod_timer
optimization.
parent 85f817cd
......@@ -220,6 +220,9 @@ extern unsigned long irq_affinity [NR_IRQS];
((1 << cpu) & (allowed_mask))
#if CONFIG_SMP
#define IRQ_BALANCE_INTERVAL (HZ/50)
static unsigned long move(int curr_cpu, unsigned long allowed_mask, unsigned long now, int direction)
{
int search_idle = 1;
......@@ -254,8 +257,9 @@ static inline void balance_irq(int irq)
if (clustered_apic_mode)
return;
if (entry->timestamp != now) {
if (unlikely(time_after(now, entry->timestamp + IRQ_BALANCE_INTERVAL))) {
unsigned long allowed_mask;
unsigned int new_cpu;
int random_number;
rdtscl(random_number);
......@@ -263,8 +267,11 @@ static inline void balance_irq(int irq)
allowed_mask = cpu_online_map & irq_affinity[irq];
entry->timestamp = now;
entry->cpu = move(entry->cpu, allowed_mask, now, random_number);
set_ioapic_affinity(irq, 1 << entry->cpu);
new_cpu = move(entry->cpu, allowed_mask, now, random_number);
if (entry->cpu != new_cpu) {
entry->cpu = new_cpu;
set_ioapic_affinity(irq, 1 << new_cpu);
}
}
}
#else /* !SMP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment