diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2011-06-06 16:50:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-07 04:01:22 -0400 |
commit | 264524d5e5195f6e0f099bee20253a22b651e272 (patch) | |
tree | bbb76f1a1f1ee31ff69d718443021576926f24cf /net | |
parent | 6407d74c5106bb362b4087693688afd34942b094 (diff) |
net: cpu offline cause napi stall
Frank Blaschka reported :
<quote>
During heavy network load we turn off/on cpus.
Sometimes this causes a stall on the network device.
Digging into the dump I found out following:
napi is scheduled but does not run. From the I/O buffers
and the napi state I see napi/rx_softirq processing has stopped
because the budget was reached. napi stays in the
softnet_data poll_list and the rx_softirq was raised again.
I assume at this time the cpu offline comes in,
the rx softirq is raised/moved to another cpu but napi stays in the
poll_list of the softnet_data of the now offline cpu.
Reviewing dev_cpu_callback (net/core/dev.c) I did not find the
poll_list is transfered to the new cpu.
</quote>
This patch is a straightforward implementation of Frank suggestion :
Transfert poll_list and trigger NET_RX_SOFTIRQ on new cpu.
Reported-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1af6cb27f67a..a54c9f87ddbb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -6178,6 +6178,11 @@ static int dev_cpu_callback(struct notifier_block *nfb, | |||
6178 | oldsd->output_queue = NULL; | 6178 | oldsd->output_queue = NULL; |
6179 | oldsd->output_queue_tailp = &oldsd->output_queue; | 6179 | oldsd->output_queue_tailp = &oldsd->output_queue; |
6180 | } | 6180 | } |
6181 | /* Append NAPI poll list from offline CPU. */ | ||
6182 | if (!list_empty(&oldsd->poll_list)) { | ||
6183 | list_splice_init(&oldsd->poll_list, &sd->poll_list); | ||
6184 | raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
6185 | } | ||
6181 | 6186 | ||
6182 | raise_softirq_irqoff(NET_TX_SOFTIRQ); | 6187 | raise_softirq_irqoff(NET_TX_SOFTIRQ); |
6183 | local_irq_enable(); | 6188 | local_irq_enable(); |