Mailing List Archive

bug.. compiler or kernel source?
The following is an extract from mm/simp.c..
67 struct simp {
68 /* 1st cache lines */
69 struct per_processor private[NR_PROCESSORS];
70 /* next cache line */
71 struct header * usable_list;
72 spinlock_t lock;
73 char fill[sizeof(void*) - sizeof(spinlock_t)];
If compiling with SMP enabled and using a compiler newer than,
said compiler says fill is too large because (x86) sizeof(void*) is 4
and sizeof(spinlock_t) is 8. Make the result an unsigned, and it's
humongous. This with egcs,pgcc, and gcc-2.8.0 (released). says
that the struct is 16384 (if I read the asm right).
Which one is correct behavior? Can this difference in behavior bite
in other places? And the real question.. is using sizeof in this
manner really OK?
At any rate, simp isn't currently used, so I chopped it out of the
'Nuther question while I'm at it. My CPU is an Overdrive-MMX150..
is that why I can't boot an SMP kernel? (yes dumb.. only to test)