Re: [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5

From: Ingo Molnar
Date: Mon Aug 30 2004 - 14:22:59 EST



* Mark_H_Johnson@xxxxxxxxxxxx <Mark_H_Johnson@xxxxxxxxxxxx> wrote:

> LONG NETWORK LATENCIES
> ======================
>
> In about 25 minutes of heavy testing, I had two latency traces with
> /proc/sys/kernel/preempt_max_latency set to 700. They had the same start /
> end location with the long delay as follows:
> 730 us, entries: 361
> ...
> started at rtl8139_poll+0x3c/0x160
> ended at rtl8139_poll+0x100/0x160

regarding this particular latency, could you try the attached patch
ontop of -Q5? It turns the ->poll() loop into separate, individually
preemptable iterations instead of one batch of processing. In theory
this should result in latency being lower regardless of the
netdev_max_backlog value.

Ingo
--- linux/net/core/dev.c.orig2
+++ linux/net/core/dev.c
@@ -1903,7 +1903,7 @@ static void net_rx_action(struct softirq
{
struct softnet_data *queue = &__get_cpu_var(softnet_data);
unsigned long start_time = jiffies;
- int budget = netdev_max_backlog;
+ int budget = netdev_max_backlog, loops;


local_irq_disable();
@@ -1926,7 +1926,10 @@ static void net_rx_action(struct softirq
dev = list_entry(queue->poll_list.next,
struct net_device, poll_list);

- if (dev->quota <= 0 || dev->poll(dev, &budget)) {
+ loops = 1;
+ if (dev->quota <= 0 || dev->poll(dev, &loops)) {
+ if (loops < 1)
+ budget--;
local_irq_disable();
list_del(&dev->poll_list);
list_add_tail(&dev->poll_list, &queue->poll_list);