Re: test13-pre5

From: Linus Torvalds (torvalds@transmeta.com)
Date: Sun Dec 31 2000 - 12:27:23 EST


On Sun, 31 Dec 2000, Andi Kleen wrote:
>
> Sounds good. It could also be controlled by a CONFIG_SPACE_EFFICIENT for
> embedded systems, where you could trade a bit of CPU for less memory overhead
> even on systems where u8 is slow and atomicity doesn't come into play
> because it's UP anyways.

UP has nothing to do with it.

The alpha systems I remember this problem on were all SMP.

Imagine an architecture where you need to do a

        load_32()
        mask-and-insert-byte
        store_32()

and imagine that an interrupt comes in:

        load_32()
        mask-and-insert-byte

                        * INTERRUPT *

                        load_32()
                        mask-and-insert-ANOTHER-byte
                        store_32()

                        interrupt return

        store_32()

and notice how the value written by the interrupt is gone, gone, gone,
even though it was to a completely different byte.

Now, imagine that the first byte is the "age", and imagine that the thing
the interrupt tries to update is "flags".

Yes, you're screwed.

I don't think it's a good diea.

                Linus

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



This archive was generated by hypermail 2b29 : Sun Dec 31 2000 - 21:00:15 EST