Re: [PATCH net-next-2.6] rps: shortcut net_rps_action()

Eric Dumazet
2010-04-20T05:55:55Z

Le mardi 20 avril 2010 à 08:32 +0800, Changli Gao a écrit :

> Oh, I read the code again and got the answer. After the IPI is sent,
> this softnet will be queued by the other CPUs. We prefetch the pointer
> rps_ipi_next to avoid this race condition.
>

Speaking of prefetch business,

I partly tested following patch, I will submit it if it happens to be a
clear win.

diff --git a/net/core/dev.c b/net/core/dev.c
index 05a2b29..fe6fc9f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2349,7 +2349,9 @@ done:
static void trigger_softirq(void *data)
{
struct softnet_data *queue = data;
+
__napi_schedule(&queue->backlog);
+ prefetch(queue->input_pkt_queue.next);
__get_cpu_var(netdev_rx_stat).received_rps++;
}
#endif /* CONFIG_RPS */