Thread (12 messages) flat view 12 messages, 6 authors, 2013-01-04

Re: [PATCH v2 net-next] softirq: reduce latencies

From: Eric Dumazet <hidden>
Date: 2013-01-04 08:23:12
Also in: lkml

On Fri, 2013-01-04 at 00:15 -0800, Joe Perches wrote:
On Thu, 2013-01-03 at 23:49 -0800, Eric Dumazet wrote:
quoted
In various network workloads, __do_softirq() latencies can be up
to 20 ms if HZ=1000, and 200 ms if HZ=100.
This patch changes the fallback to ksoftirqd condition to :
- A time limit of 2 ms.
[]
quoted
diff --git a/kernel/softirq.c b/kernel/softirq.c
[]
quoted
+#define MAX_SOFTIRQ_TIME  max(1, (2*HZ/1000))
And if HZ is 10000?
 
Then its OK.  2*10000/1000 -> 20 ticks -> 2 ms

quoted
 asmlinkage void __do_softirq(void)
 {
[]
quoted
+	unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
Perhaps MAX_SOFTIRQ_TIME should be

#define MAX_SOFTIRQ_TIME msecs_to_jiffies(2)

though it would be nicer if it were a compile time constant.
If you send a patch to convert msecs_to_jiffies() to an inline function
when HZ = 1000, I will gladly use it instead of (2*HZ/1000)

Right now, max(1, msecs_to_jiffies(2)) uses way too many instructions,
while it should be the constant 2, known at compile time.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help