On Sat, Aug 13, 2005 at 02:10:55PM -0700, David S. Miller wrote:
> Yes, you need an atomic in the fast path, but it's only done
> for fast clones and their parent SKBs, and such an atomic is
> _MUCH_ cheaper than a kmem_cache_alloc especially since it
> touches more cache local state (the atomic counter in the parent
> SKB, whose cache line is hot for the first transmit of an SKB
> usually).

Good point about the potential for cache misses and cache eviction
with calling kmem_cache_alloc twice far apart from each other.
But what about the following scheme for fast clones:

1) When you allocate for fast clones you do two kmem_cache_alloc's
in a row.  You store the second pointer in the shared skb data area.

The fast path within kmem_cache_alloc is good enough that the second
one should be free most of the time.

2) When you do a clone just use the stored pointer and forget about
it since it can be freed independently of the first.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to