diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-03 20:14:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-03 20:14:38 -0500 |
commit | 24f8b2385e03a4f4c8dac513d03b5eaa475822b9 (patch) | |
tree | 28ed1f956f3f140cf813f25ac166ad9d3a0cd2ab /net/core | |
parent | b9ac99855dcc0316ba2feee2b0d3e578f8315b75 (diff) |
net: increase receive packet quantum
This patch gets about 1.25% back on tbench regression.
My change to NAPI for multiqueue support changed the time limit on
network receive processing. Under sustained loads like tbench, this
can cause the receiver to reschedule prematurely.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 3a2b8be9e67b..8f9d3b38a44b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2373,7 +2373,7 @@ EXPORT_SYMBOL(__napi_schedule); | |||
2373 | static void net_rx_action(struct softirq_action *h) | 2373 | static void net_rx_action(struct softirq_action *h) |
2374 | { | 2374 | { |
2375 | struct list_head *list = &__get_cpu_var(softnet_data).poll_list; | 2375 | struct list_head *list = &__get_cpu_var(softnet_data).poll_list; |
2376 | unsigned long start_time = jiffies; | 2376 | unsigned long time_limit = jiffies + 2; |
2377 | int budget = netdev_budget; | 2377 | int budget = netdev_budget; |
2378 | void *have; | 2378 | void *have; |
2379 | 2379 | ||
@@ -2384,13 +2384,10 @@ static void net_rx_action(struct softirq_action *h) | |||
2384 | int work, weight; | 2384 | int work, weight; |
2385 | 2385 | ||
2386 | /* If softirq window is exhuasted then punt. | 2386 | /* If softirq window is exhuasted then punt. |
2387 | * | 2387 | * Allow this to run for 2 jiffies since which will allow |
2388 | * Note that this is a slight policy change from the | 2388 | * an average latency of 1.5/HZ. |
2389 | * previous NAPI code, which would allow up to 2 | ||
2390 | * jiffies to pass before breaking out. The test | ||
2391 | * used to be "jiffies - start_time > 1". | ||
2392 | */ | 2389 | */ |
2393 | if (unlikely(budget <= 0 || jiffies != start_time)) | 2390 | if (unlikely(budget <= 0 || time_after(jiffies, time_limit))) |
2394 | goto softnet_break; | 2391 | goto softnet_break; |
2395 | 2392 | ||
2396 | local_irq_enable(); | 2393 | local_irq_enable(); |