Skip to contentSkip to conversation

upwards growing stacks ??

DISCUSSION Matthew Wilcox 1 participant 1 message Oct 4, 1999 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]

#1 lore raw
Quoted 8 lines · Linas Vepstas

I've been porting the kernel to the ESA/390 architecture (mainframe) and have had the occasion to rethink the subroutine linkage. In particular, I have some weak reasons to want the stack to grow up, not down. However, the unix tradition & linux in particular usually have the stack grow down. So the questions:

-- is it a bad idea to make the stack grow up?
-- has anyone done this before w/ linux? (doesn't seem like it ...)

Some people are doing this right now with Linux/PARISC. The only thing which affected me was in fs/binfmt_*.c where we tamper with the argc / envp. Alan tells me the mklinux people have sorted this one properly, but I haven't looked yet. There are probably other places where there are problems. Philipp?

Quoted 1 line

-- should I do this, or should I stick to the traditional design?

It's something which we need to fix for PARISC, so I think you should do it too :-)

Quoted 7 lines

-- I'm making the following mods, will these be sufficient?
Are they appropriate?
o the expand_stack() inline in include/linux/mm.h assumes the stack grows down, & I will rework it to suit my needs ...
o change VM_STACK_FLAGS to grow up as well ...
o create a new vma that holds the stack base, out in high-memory,

      somewhere near TASK_SIZE - current->rlim[RLIMIT_STACK].rlim_cur
Signature · 4 lines
Matthew Wilcox <[email protected]>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson