Skip to contentSkip to conversation

TASK_UNMAPPED_BASE & stack location

DISCUSSION Andi Kleen 3 participants 3 messages Apr 25, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 3 lines · Martin J. Bligh

Is there any good reason we can't remove TASK_UNMAPPED_BASE, and just shove libraries directly above the program text? Red Hat seems to have patches to dynamically tune it on a per-processes basis anyway ...

Yes. You won't get a continuous sbrk/brk heap then anymore. Not sure it is a big problem though.

But apparently Solaris/x86 is doing that.

It's probably worth a sysctl at least.

Quoted 3 lines

Moreover, can we put the stack back where it's meant to be, below the program text, in that wasted 128MB of virtual space? Who really wants

Quoted 1 line

128MB of stack anyway (and can't fix their app)?

You could, but I bet it would break some programs
(e.g. just moving __PAGE_OFFSET on amd64 to 4GB for 32bit broke some things)

-Andi

#2 lore raw
Quoted 3 lines · Martin J. Bligh
Quoted 3 lines

Is there any good reason we can't remove TASK_UNMAPPED_BASE, and just shove libraries directly above the program text? Red Hat seems to have patches to dynamically tune it on a per-processes basis anyway ...

Quoted 4 lines · Andi Kleen

Yes. You won't get a continuous sbrk/brk heap then anymore. Not sure it is a big problem though.
But apparently Solaris/x86 is doing that.
It's probably worth a sysctl at least.

How about a personality? It is a very slightly different ABI.

-- wli

#3 lore raw
In reply to Andi Kleen
Quoted 6 lines
Quoted 3 lines

Is there any good reason we can't remove TASK_UNMAPPED_BASE, and just shove libraries directly above the program text? Red Hat seems to have patches to dynamically tune it on a per-processes basis anyway ...

Yes. You won't get a continuous sbrk/brk heap then anymore. Not sure it is a big problem though.

Me no understand. I think this *makes* it a contiguous space. The way I see it, we currently allocate from TASK_UNMAPPED_BASE up to the top, then start again above program text. Which seems a bit silly.

Quoted 1 line

It's probably worth a sysctl at least.

mmm. I'd prefer a config option. Defaulting to 'y' ;-)

Quoted 7 lines
Quoted 3 lines

Moreover, can we put the stack back where it's meant to be, below the program text, in that wasted 128MB of virtual space? Who really wants

Quoted 1 line

128MB of stack anyway (and can't fix their app)?

You could, but I bet it would break some programs
(e.g. just moving __PAGE_OFFSET on amd64 to 4GB for 32bit broke some things)

I've moved PAGE_OFFSET around a lot (which moves the stack, as you say). Haven't seen it break anything yet ... IMHO it was broken anyway if this hurts it. Obviously not something one could do in a stable kernel series, but 2.5 seems like a perfect time for it to me ... unless I'm missing some glibc / linker thing, it seems like a simple change.

M.