In softirq.c, statement
static struct softirq_action softirq_vec[32] __cacheline_aligned;
I am trying to figure out why this is cacheline_alligned. I wrote a small piece of code to see how this may work ....
struct s { void (*action) (struct s *); int *data; };
int main() { int k; static struct s ss[32] __attribute__((__aligned__(32))) ; printf("first %x second %x \n",&ss[0],&ss[1]); }
on executing this I get
Which means the two elements of ss[] are 8 bytes apart. (ie sizeof struct s)first 80494e0 second 80494e8.
I achive the 32 byte alignment by modifing the code as below. struct s { void (*action) (struct s *); int *data; }__attribute__((__aligned__(32))) ;
and declaring static struct s ss[32];
on executing I get
ie 2 elemnts are 32 byte apart.first 80494e0 second 8049500
Please let me know what I am missing here.
Regards, Rohit. ___________________________________________________ Art meets Army ; Swapna Weds Capt. Rajsekhar. Rediff Matchmaker strikes another interesting match !! Visit http://matchmaker.rediff.com?2
- : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html