linux-2.6.1 x86_64 : STACK_TOP and text/data

From: dada1
Date: Tue Jan 27 2004 - 04:27:18 EST


Hi all

Anybody knows why STACK_TOP is defined to 0xc0000000 in x86_64 ?

This means that stack allocated variables are all in the first 4GB quadrant in memory.
As the default virtual addresses of text/data of a programm are in this same quadrant, some programming errors could be undetected.
(Some programmers could still cast some pointers to 'unsigned int' for example, and this could 'work')

Tru64 has a different strategy :
Program text starts at 0x120000000
Program data starts at 0x140000000
Stack is just under text, but still not in the first 4GB quadrant.

This way, programmers errors are likely to be detected at dev time.

Another point is that BSS zone (heap) cannot exceed 3GB in x86_64 mode, since the brk hit the stack.
libc malloc then fallback to use a lot of arenas... suboptimal in terms of vmas.

Strangely, in ia32 emulation mode, the stack is placed at the 4GB limit !

Thank you
Eric Dumazet

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