struct sk_buff layout
Oct. 10th, 2010 07:07 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
struct sk_buff is quite big (for a reason), 4 cache lines.
The way it's being accessed in a fast path (in reverse order), when system is running a network throughput benchmark fools h/w prefetcher on x86, makes it prefetching random data. This becomes quite noticeable on 10G, I've checked with Vtune.
There may be a way to re-arrange the layout of the struct so the prefetcher would stop issuing unnecessary memory reads, saving cache capacity and memory traffic. But I would not bother doing it because it is I think too x86 specific to be accepted to the kernel. And yes, I have not tested on AMD either.
The way it's being accessed in a fast path (in reverse order), when system is running a network throughput benchmark fools h/w prefetcher on x86, makes it prefetching random data. This becomes quite noticeable on 10G, I've checked with Vtune.
There may be a way to re-arrange the layout of the struct so the prefetcher would stop issuing unnecessary memory reads, saving cache capacity and memory traffic. But I would not bother doing it because it is I think too x86 specific to be accepted to the kernel. And yes, I have not tested on AMD either.