Re: [PATCH 2/2] udp: RCU handling for Unicast packets.
From: Eric Dumazet <hidden>
Date: 2008-10-30 11:31:00
From: Eric Dumazet <hidden>
Date: 2008-10-30 11:31:00
Peter Zijlstra a écrit :
On Wed, 2008-10-29 at 21:00 +0100, Eric Dumazet wrote:quoted
Hum... Another way of handling all those cases and avoid memory barriers would be to have different "NULL" pointers. Each hash chain should have a unique "NULL" pointer (in the case of UDP, it can be the 128 values : [ (void*)0 .. (void *)127 ]Why not use the bucket pointer as terminating condition? Because all you really need is a pointer that is specific per bucket, and not a valid element, right?
Yes, but it forces compiler to keep around the bucket pointer. Big chance this value will be stored on stack. Next patch will use the least significant bit to distinguish a valid pointer from a "NULL pointer"