Re: [Lse-tech] Re: (RFC): SKB Initialization

Benjamin LaHaise (bcrl@redhat.com)
Thu, 22 Aug 2002 14:32:52 -0400


On Thu, Aug 22, 2002 at 12:22:34PM -0500, Mala Anand wrote:
> I would like to stress again that this patch helps only when the
> allocations
> and frees occur on two different CPUs. I measured it in a UNI system and
> did not see any impact.

Thanks, that looks a lot more complete. We discussed this on irc a bit, and
Andi Kleen pointed out that several years of hacking on skbs has probably
changed the layout significantly from the original intention of keeping all
the initializations to a cacheline or two. I also pointed out that it might
be worth looking at cache misses and perhaps adding a prefetch instruction
or two, especially during allocation when an skb will be used immediately.
Another point is to check the order of writes that gcc is generating to the
skb: if the writes are sequential, the cpu can combine them and make use of
the internal 64 bit bus to the cache. In combination with write buffers in
the cpu, that makes the writes in __kfree_skb almost free, but if the cache
lines are spread out or cold, that would explain the degredation you're
seeing. Cheers,

-ben
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/