A variant lets you put the pointer at the top of the stack, where it can
sometimes share a cache line with the freshly pushed context:
movl $0x1ffc,%0
orl %esp,%0
movl (%0), %0
This works because GCC keeps the stack aligned to 4 bytes at all times,
I believe.
Both this simple sequence, and Alan's code, suffer from the problem that
the pointer itself is not cache-coloured, but it is a lot better than
having the whole context and task state on the same colour.
This perhaps be improved using Linus' idea of shifting upper address
bits to colour the pointer as well.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/