Re: userspace-app stack - dynamic?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guennadi Liakhovetski <gl@dsa-ac.de> [2003-09-12 17:47]:
> On Fri, 12 Sep 2003, Lukas Ruf wrote:
> 
> > 2.4.21:
> > ./include/linux/sched.h:
> > /*
> >  * Limit the stack by to some sane default: root can always
> >  * increase this limit if needed..  8MB seems reasonable.
> >  */
> > #define _STK_LIM  (8*1024*1024)
> >
> > a way to address:
> >
> > man 3 ulimit
> > man bash
> >   and in there:
> >   / ulimit
> 
> Yes, this is the _limit_, but I don't think each task gets 8Mb stack on
> creation:-) So, it gets some stack, and then it is dynamically allocated
> up-to the limit.
> 

If you take a look at ./include/linux/sched.h, you find 

./sched.h:# define INIT_TASK_SIZE       2048*sizeof(long)
./sched.h:      unsigned long stack[INIT_TASK_SIZE/sizeof(long)];

> > btw, I would consider allocating 8 mega bytes on the stack not very good
> > programming style....
> 
> No, I was thinking more like 8K:-)
> 
well, this, at least, should work without problems ,-)

wbr,
Lukas
-- 
Lukas Ruf           | Wanna know anything about raw |
<http://www.lpr.ch> | IP?  <http://www.rawip.org>   |
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux