optimize prefetch() usage in skb_queue_walk()
PATCH 1/1 optimize prefetch() usage in skb_queue_walk()
Hello.
This patch changes skb_queue_walk() in the same manner as in list_for_each() prefetch optimization, see
http://marc.theaimsgroup.com/?l=linux-kernel&m=110399132418587
Oleg.
Signed-off-by Oleg Nesterov <[email protected]>
include/linux/skbuff.h renamed from include/linux/skbuff.h~ +3 -3
@@ -1071,9 +1071,9 @@ }#define skb_queue_walk (queue, skb) \ - for (skb = (queue)->next, prefetch(skb->next); \ - (skb != (struct sk_buff *)(queue)); \ - skb = skb->next, prefetch(skb->next)) + for (skb = (queue)->next; \ + prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ + skb = skb->next) extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
Quoted 3 lines · On Mon, 27 Dec 2004 19:05:10 +0300 Oleg Nesterov <[email protected]> wrote:
This patch changes
skb_queue_walk()in the same manner as inlist_for_each()prefetch optimization, see
http://marc.theaimsgroup.com/?l=linux-kernel&m=110399132418587
Applied, thanks Oleg.