Re: Fix locking in input

From: Timothy Miller
Date: Wed Dec 03 2003 - 18:43:34 EST

Manfred Spraul wrote:
Russell King wrote:

On Sun, Nov 23, 2003 at 11:24:02PM +0100, Manfred Spraul wrote:

I think one platform (early ARM?) cannot access bytes directly, and implement the access with read 16-bit, change 8-bit, write back 16 bit.


It seems it's Alpha:

On Thu, 28 Dec 2000, Linus wrote:

FreeBSD doesn't try to be portable any more, but Linux does, and there are
architectures where 8- and 16-bit accesses aren't *atomic* but have to be
done with read-modify-write cycles.

And even for fields like "age", where we don't care whether the age itself
is 100% accurate, we _do_ care that the fields close-by don't get strange
effects from updating "age". We used to have exactly this problem on alpha
back in the 2.1.x timeframe.

This is MOSTLY true, but not entirely. As I recall, Alpha has two addressing modes: Sparse and Dense.

The mode you're referring to is dense addressing where 32-bit and 64-bit accesses are atomic, but 16 and 8 bit accesses require RMW.

Sparse mode allows for atomic 8 and 16 bit accesses, but the access size is specified in the address using a rather bizarre binary encoding that doesn't look much like a regular address value. You would probably not want to use this unless you absolutely HAD to use some I/O device that required atomic byte or word accesses.

I'm sure someone else will (or already has) pipe(d) in with a more accurate explanation. :)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at