[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Kernel stack for a process
Nagaraj wrote:
>
> Hiiiyooo,
>
> Ive another silly question.
> I gather that max kernel stack allocated for a process
> is 8k ( 2 pages ) by the linux kernel. ( correct me if im wrong here ).
>
> If so, what happens when a dirty recursive program
> never stops ?
You have a nice big smoking crater in the landscape. Kernel
code is carefully written to avoid deep call nesting.
The stack isn't even 8k, because the task struct lives
in that 2-page block as well. (I'm not sure if GCC
is smart enough to do tail-recursion optimization or
not, but I wouldn't count on it.)
Cheers,
-- Joe
"I'd rather chew my leg off than maintain Java code, which
sucks, 'cause I have a lot of Java code to maintain and
the leg surgery is starting to get expensive." - Me
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/