Re: hammer: MAP_32BIT

Edgar Toernig (froese@gmx.de)
Sat, 10 May 2003 02:00:25 +0200


Ulrich Drepper wrote:
> > Why does there ever need to be an explicit HINT that you would prefer a
> > <32 bit address, when it's known a priori that <32 is better? Why
> > doesn't the mapping code ALWAYS try to use 32-bit addresses before
> > resorting to 64-bit?
>
> Because not all memory is addressed via GDT entries. In fact, almost
> none is, only thread stacks and similar gimicks. If all mmap memory
> would by default be served from the low memory pool you soon run out of
> it and without any good reason.

As if there are so many apps that would suffer from that...

Anyway, what's so bad about the idea someone (Linus?) suggested?
Without MAP_FIXED the address given to mmap is already taken as a
hint where to start looking for free memory. So use mmap(4GB,...)
for regular memory and mmap(4kB, ...) for stacks. What's wrong
with that? And if you are really frightend to run out of "low"
memory make the above-4GB allocation the default for addr==0.

Ciao, ET.
-
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/