> Umm. i386 spinlocks could and should be *one*byte*.> > In fact, I don't even know why they are wasting four bytes right now: > the fact that somebody made them an "int" just wastes memory. All the > actual code uses "decb", so it's not even a question of safety. I > wonder why we have that 32-bit thing and the ugly casts.> > Ingo, any memory of that?

no real reason that i can recall - i guess nobody dared to touch it because it used to have that 'volatile', indicating black voodoo ;-) Now that the bad stigma has been removed, we could try the patch below. It boots fine here, and we save 1K of kernel text size:

I can understand why no data is saved by this change: gcc is aligning the next field to a natural boundary anyway and we dont really have arrays of spinlocks (fortunately). [and we save no data even if using the ((packed)) attribute.] Perhaps some data structure that is never in the kernel image itself still got smaller? Any good way to determine that?

but this is certainly not something for 2.6.22, it's an early 2.6.23 matter i suspect.

Ingo

------------------->From: Ingo Molnar <mingo@elte.hu>Subject: [patch] spinlocks i386: change them to byte fieldsall spinlock ops are on byte operands, so change the spinlock field to be unsigned char. This saves a bit of kernel text size: