The maximum size of stack in linuxppc kernel

Tom Rini trini at kernel.crashing.org
Sat Apr 20 01:00:26 EST 2002


On Fri, Apr 19, 2002 at 07:52:53AM -0400, Neil Horman wrote:

> Hello-
>     The exact size of the stack is based on the size of the task_union structure
> in sched.h.  Because of the way a union works in C the task_struct defined in
> the union is aligned toward the low address end of the structure, which is
> overall 8K in length, to satisfy the stack variable space requirements.  The
> remainder of that space is used as kernel stack on behalf of whichever process
> causes a trap into the kernel.  I think in the event of an interrupt, the kernel
> stack used is whichever one the current variable points to.  So to summarize,
> the total allocated kernel stack size for any given process is 8K minus the size
> of the task structure defined in sched.h

And, if you're finding your self in need of growing the stack, you need
to stop and think about what you're doing since this is almost always
the wrong approach.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list