netdev
[Top] [All Lists]

Re: [PATCH] Add prefetches in net/ipv4/route.c

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: [PATCH] Add prefetches in net/ipv4/route.c
From: Eric Dumazet <dada1@xxxxxxxxxxxxx>
Date: Thu, 28 Jul 2005 22:56:32 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20050728.123922.126777020.davem@xxxxxxxxxxxxx>
References: <20050704.160140.21591849.davem@xxxxxxxxxxxxx> <42CA390C.9000801@xxxxxxxxxxxxx> <42E8FF24.9070009@xxxxxxxxxxxxx> <20050728.123922.126777020.davem@xxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
David S. Miller a écrit :
From: Eric Dumazet <dada1@xxxxxxxxxxxxx>
Date: Thu, 28 Jul 2005 17:52:04 +0200


[NET] : Adds prefetches in route hash list traversals.

The actual code doesnt use a prefetch enabled macro like
list_for_each_rcu(), so manually add prefetch() hints.


and the measured performance improvement is?


Half the improvement we could get if only fl.fl4_dst, and other fields were not 
so far away from the u.rt_next field. (0xE8 on x86_64)

For good performance, one should of course choose a big route cache hash size, and in this case, prefetchs are useless, and even cost an extra load : prefetch(rth->u.rt_next) imply the load of the rt_next pointer at the start of rth structure, while the fl fields are on a different cache line)

But in case of DDOS, prefetches are a win.

I did not test a solution using two prefetches...

Other patches using prefetches will follow.

Eric

<Prev in Thread] Current Thread [Next in Thread>