mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] optimize prefetch() usage in skb_queue_walk()
@ 2004-12-27 16:05 Oleg Nesterov
  2004-12-28  5:52 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2004-12-27 16:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: David S. Miller, Andrew Morton

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@tv-sign.ru>

--- 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,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] optimize prefetch() usage in skb_queue_walk()
  2004-12-27 16:05 [PATCH] optimize prefetch() usage in skb_queue_walk() Oleg Nesterov
@ 2004-12-28  5:52 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-12-28  5:52 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-kernel, akpm

On Mon, 27 Dec 2004 19:05:10 +0300
Oleg Nesterov <oleg@tv-sign.ru> wrote:

> 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

Applied, thanks Oleg.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-12-28  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-27 16:05 [PATCH] optimize prefetch() usage in skb_queue_walk() Oleg Nesterov
2004-12-28  5:52 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome