LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] net: increase receive packet quantum
@ 2008-11-03 21:03 Stephen Hemminger
2008-11-04 1:24 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2008-11-03 21:03 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, netdev
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>
--- a/net/core/dev.c 2008-11-03 11:11:44.000000000 -0800
+++ b/net/core/dev.c 2008-11-03 11:16:07.000000000 -0800
@@ -2373,7 +2373,7 @@ EXPORT_SYMBOL(__napi_schedule);
static void net_rx_action(struct softirq_action *h)
{
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;
void *have;
@@ -2384,13 +2384,10 @@ static void net_rx_action(struct softirq
int work, weight;
/* If softirq window is exhuasted then punt.
- *
- * Note that this is a slight policy change from the
- * previous NAPI code, which would allow up to 2
- * jiffies to pass before breaking out. The test
- * used to be "jiffies - start_time > 1".
+ * Allow this to run for 2 jiffies since which will allow
+ * an average latency of 1.5/HZ.
*/
- if (unlikely(budget <= 0 || jiffies != start_time))
+ if (unlikely(budget <= 0 || time_after(jiffies, time_limit)))
goto softnet_break;
local_irq_enable();
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: increase receive packet quantum
2008-11-03 21:03 [PATCH] net: increase receive packet quantum Stephen Hemminger
@ 2008-11-04 1:24 ` David Miller
2008-11-04 5:25 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2008-11-04 1:24 UTC (permalink / raw)
To: shemminger; +Cc: linux-kernel, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 3 Nov 2008 13:03:03 -0800
> 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>
I think I'm the guilty party that made that change to your
NAPI patches.
I'll apply this to net-next-2.6, thanks Stephen.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: increase receive packet quantum
2008-11-04 1:24 ` David Miller
@ 2008-11-04 5:25 ` Stephen Hemminger
2008-11-04 22:48 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2008-11-04 5:25 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, netdev
On Mon, 03 Nov 2008 17:24:28 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Mon, 3 Nov 2008 13:03:03 -0800
>
> > 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>
>
> I think I'm the guilty party that made that change to your
> NAPI patches.
>
> I'll apply this to net-next-2.6, thanks Stephen.
Maybe you want it as part of the tbench regression recovery in 2.6.28?
it seems mostly harmless.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: increase receive packet quantum
2008-11-04 5:25 ` Stephen Hemminger
@ 2008-11-04 22:48 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2008-11-04 22:48 UTC (permalink / raw)
To: shemminger; +Cc: linux-kernel, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 3 Nov 2008 21:25:21 -0800
> On Mon, 03 Nov 2008 17:24:28 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
>
> > I'll apply this to net-next-2.6, thanks Stephen.
>
> Maybe you want it as part of the tbench regression recovery in 2.6.28?
> it seems mostly harmless.
Maybe...
I'd rather have it cook in net-next-2.6 for a while.
Taking up more than a jiffie in softirq context is
bordering on anti-social and could cause problems
especially for RT'ish stuff.
And I'm pretty sure that's why I made the change.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-04 22:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 21:03 [PATCH] net: increase receive packet quantum Stephen Hemminger
2008-11-04 1:24 ` David Miller
2008-11-04 5:25 ` Stephen Hemminger
2008-11-04 22:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).