diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2011-02-03 00:06:08 -0800 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2011-02-03 00:06:08 -0800 |
commit | c1eb2494559fb0f6ee2beecaedb2a415ff096056 (patch) | |
tree | 9ddce36d0812e247c02db399c6ba1ed70bdc2ef7 /scripts | |
parent | 82cc765810fb303cecd1ba3167d36d7adbedbfa4 (diff) | |
download | vyatta-cfg-quagga-c1eb2494559fb0f6ee2beecaedb2a415ff096056.tar.gz vyatta-cfg-quagga-c1eb2494559fb0f6ee2beecaedb2a415ff096056.zip |
Bugfix 6773: Spread load of single-queue NICs across all CPUs.
The initial CPU selection function needs to take hyperthreading
into account.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/system/irq-affinity.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl index fec90dc3..cf68c0d1 100755 --- a/scripts/system/irq-affinity.pl +++ b/scripts/system/irq-affinity.pl @@ -157,7 +157,11 @@ sub first_cpu { unless defined($ifunit); my $threads = threads_per_core(); - return ( $ifunit * $threads ) % $cpus; + # Give the load first to one CPU of each hyperthreaded core, then + # if there are enough NICs, give the load to the other CPU of + # each core. + my $ht_wrap = (($ifunit * $threads) / $cpus) % $threads; + return ((($ifunit * $threads) + $ht_wrap) % $cpus); } # Assignment for multi-queue NICs |