Commit 24f8b238 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b9ac9985
...@@ -2373,7 +2373,7 @@ EXPORT_SYMBOL(__napi_schedule); ...@@ -2373,7 +2373,7 @@ EXPORT_SYMBOL(__napi_schedule);
static void net_rx_action(struct softirq_action *h) static void net_rx_action(struct softirq_action *h)
{ {
struct list_head *list = &__get_cpu_var(softnet_data).poll_list; struct list_head *list = &__get_cpu_var(softnet_data).poll_list;
unsigned long start_time = jiffies; unsigned long time_limit = jiffies + 2;
int budget = netdev_budget; int budget = netdev_budget;
void *have; void *have;
...@@ -2384,13 +2384,10 @@ static void net_rx_action(struct softirq_action *h) ...@@ -2384,13 +2384,10 @@ static void net_rx_action(struct softirq_action *h)
int work, weight; int work, weight;
/* If softirq window is exhuasted then punt. /* If softirq window is exhuasted then punt.
* * Allow this to run for 2 jiffies since which will allow
* Note that this is a slight policy change from the * an average latency of 1.5/HZ.
* previous NAPI code, which would allow up to 2
* jiffies to pass before breaking out. The test
* used to be "jiffies - start_time > 1".
*/ */
if (unlikely(budget <= 0 || jiffies != start_time)) if (unlikely(budget <= 0 || time_after(jiffies, time_limit)))
goto softnet_break; goto softnet_break;
local_irq_enable(); local_irq_enable();
......
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