Re: Re : 2.4.0-test2 doesn't compile

From: Peter Rival (frival@zk3.dec.com)
Date: Mon Jun 26 2000 - 14:56:54 EST


Richard Henderson wrote:
<snip>

> > 2. proper place for such fixes is asm/spinlock.h
>
> No it's not. We only want to force alignment on global varaiables.
> Putting the alignment on the spinlock wastes *lots* of space when
> spinlocks are put into structures. Consider such infrequently used
> items as inodes and sockets.
>

Although this would suggest that we should also be very careful to make sure
people don't do something dumb like putting multiple spinlocks together in
structures either. This could potentially have the same problems as global
variables (particularly if they are as heavily used as the two mentioned here
are).

The difference (and the reason we see this in EV6 and not EV5/56) is that EV6
uses cacheline management to handle the success/failure of locked sequences,
whereas EV5 uses a lock_flag bit in the CPU. If you write to a cacheline on
CPU1 while CPU0 is attempting to do a locked access on a different piece of
data in the same cacheline, the locked access will fail. If this keeps
happening over and over again, things could get ugly.

If we are going to depend on only so much alignment, we should probably make
sure that the locking docs mention the above factoid about structs as well.
Of course, this is all a little sleep-deprived, so feel free to correct me if
any of the above (which I _think_ I'm taking from the Alpha ARM) is wrong...

 - Pete

-
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/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:09 EST