[PATCH] optimize prefetch() usage in skb_queue_walk()
From: Oleg Nesterov
Date: Mon Dec 27 2004 - 10:04:16 EST
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 <oleg@xxxxxxxxxx>
--- 2.6.10/include/linux/skbuff.h~ 2004-12-26 12:52:43.000000000 +0300
+++ 2.6.10/include/linux/skbuff.h 2004-12-26 12:54:33.000000000 +0300
@@ -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,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/