From: Junchang Wang Date: Wed, 8 Dec 2010 16:55:16 +0000 (+0000) Subject: pktgen: adding prefetchw() call X-Git-Tag: v3.12-rc1~7851^2~257 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8d764b9832d3cc86019f71916665dd2d337d7c2;p=kernel%2Fkernel-generic.git pktgen: adding prefetchw() call We know for sure pktgen is going to write skb->data right after *_alloc_skb, causing unnecessary cache misses. Idea is to add a prefetchw() call to prefetch the first cache line indicated by skb->data. On systems with Adjacent Cache Line Prefetch, it's probably two cache lines are prefetched. With this patch, pktgen on Intel SR1625 server with two E5530 quad-core processors and a single ixgbe-based NIC went from 8.63Mpps to 9.03Mpps, with 4.6% improvement. Signed-off-by: Junchang Wang Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 2953b2a..18fe20d 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2660,6 +2660,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, sprintf(pkt_dev->result, "No memory"); return NULL; } + prefetchw(skb->data); skb_reserve(skb, datalen); @@ -3007,6 +3008,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, sprintf(pkt_dev->result, "No memory"); return NULL; } + prefetchw(skb->data); skb_reserve(skb, 16);