lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101209025511.GC5379@Desktop-Junchang>
Date:	Thu, 9 Dec 2010 10:55:16 +0800
From:	Junchang Wang <junchangwang@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	eric.dumazet@...il.com, robert.olsson@....uu.se,
	john.r.fastabend@...el.com, andy.shevchenko@...il.com,
	netdev@...r.kernel.org, wangjc@...l.ustc.edu.cn
Subject: [PATCH net-next-2.6] pktgen: adding prefetchw() call

On Wed, Dec 08, 2010 at 10:17:43AM -0800, David Miller wrote:
>Your patch was corrupted by your email client, please fix this up
>and resubmit.
Sorry. I'll avoid this next time.  Here's a new version, and I had tested it.
Thanks David and Eric.


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 <junchangwang@...il.com>
Acked-by: Eric Dumazet <eric.dumazet@...il.com>
---
 net/core/pktgen.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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);
 
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ