One of the [many] nice properties of the traditional Don Becker drivers has been that often the driver-private structures are arranged such that the structure is broken up on cacheline boundaries. Th
David S. Miller wrote: Can't the cacheline_aligned attribute be applied to individual struct members? I remember doing this for thread_struct on sparc ages ago. I was hoping someone who knows gcc bet
David S. Miller wrote: Can't the cacheline_aligned attribute be applied to individual struct members? I remember doing this for thread_struct on sparc ages ago. Looks like it from the 2.4 processor.h
It needs padding _only_ on SMP. ____cacheline_aligned_in_smp. struct foo { int a; int b __attribute__((__aligned__(1024))); int c; } foo; main() { printf("%d\n", sizeof(struct foo)); printf("%d\n", o
It needs padding _only_ on SMP. ____cacheline_aligned_in_smp. non-smp machines lack L2 caches? That's new to me :-) More seriously, there are real benefits on non-SMP systems.
Andrew Morton wrote: It needs padding _only_ on SMP. ____cacheline_aligned_in_smp. [...] So your patch will do what you want it to do. You should just tag the first member of a group with ____cacheli
What do you all think about this: include <stdio.h> struct S { __cacheline_start int x; __cacheline_start int y; int z; }; int main() { struct S s; printf("%d\n",sizeof(struct S)); printf("%d\n",offs
J.A. Magallon wrote: On 2002.12.08 Andrew Morton wrote: Jeff Garzik wrote: David S. Miller wrote: Can't the cacheline_aligned attribute be applied to individual struct members? I remember doing this
That will generate a warning on faster^Wolder versions of gcc. mnm:/home/akpm> gcc t2.c t2.c:11: warning: unnamed struct/union that defines no instances t2.c:15: warning: unnamed struct/union that de
Oh I see what you want - to be able to pick up all the operating fields in a single fetch. That will increase the overall cache footprint though. I wonder if it's really a net win, over just keeping
And how 'bout this (do not have any gcc oldie available to test): It passes gcc-3.2 -Wall... I think it's nicer to insert __c_s than to go field by field marking them... -- J.A. Magallon <jamagallon@
The structure contains an __aligned__(1024) item. Think about an array of 'struct foo' items. They have to be 2048 bytes or you won't align correctly. C allows for empty space in structure padding, b
Then I am most confused. None of these fields will be put under busmastering or anything like that, so what advantage is there in spreading them out? When you are in the "tx path" you'll take one L2
There's another case where it matters, I guess one could look at it as similar to the SMP case, but between CPU and device. Some devices have producer indices in host memory which they update whenev
One of the [many] nice properties of the traditional Don Becker drivers has been that often the driver-private structures are arranged such that the structure is broken up on cacheline boundaries. Th
Looks like it from the 2.4 processor.h code. Attached is cut #2. Thanks for all the near-instant feedback so far :) Andrew, does the attached still need padding on SMP? == drivers/net/tg3.c 1.41 vs e