Re: [patch] smp-2.3.29-B2, spinlocks, reboot

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Wed, 24 Nov 1999 13:34:54 +0100


Robert Redelmeier wrote:
> My understanding is that you don't have a chance of atomicity unless
> the address is aligned [so it won't cross cache lines]. I've observed
> gcc being very poor at alignment, inserting .align 2 when .align 4 would
> have been better. And gas using the last given .align when there are
> multiples. So movb is a good idea. Or is there something else?

The movb is a smaller instruction, that's all.
There is no alignment problem -- spinlocks are always properly aligned.

If gcc is inserting .align 2 in ELF output, that should be because the
object/structure only requires 2 byte alignment. I.e., the largest
element is a short. .align 2 is perfectly normal in a.out output, where
it means "align to 1<<2".

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/