Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: How can i expand the stack size from 4K to 8K in kernel driver?

5 views
Skip to first unread message

Joss Shen

unread,
Dec 16, 1997, 3:00:00 AM12/16/97
to

Hi there,

I'm doing a big network driver under Banyan Vines 7.0 (derived from AT&T
SysV source tree). My problem is: the default 4K stack size is too small
to my driver, how can i expand it to e.g. 8Kb? Is there any tunable
parameter could make it done easily?

Thanks in advance!
Joss

Joerg Schilling

unread,
Dec 17, 1997, 3:00:00 AM12/17/97
to

In article <3496CC94...@activetouch.com>,

Modify your driver so that it does not have too much local (automatic) vars
inside the functions. I cannot believe that the 4k limit is is reached because
of recursion or procedure calls.

Joerg

--
EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
j...@cs.tu-berlin.de (uni) If you don't have iso-8859-1
j...@fokus.gmd.de (work) chars I am J"org Schilling
URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix

Joss Shen

unread,
Dec 17, 1997, 3:00:00 AM12/17/97
to Joerg Schilling

Hi,

The source code size of the driver is over 10Mb (it's true!). At first,
it's written to run in WinNT4.0, and it really exceeded NT's 4Kb stack
limit and make NT down. I don't think i could modify local variables to
static by my hand and it will produce re-entry problems to functions.

I changed some stack size related parameters in /usr/include/sys/param.h
and rebuilt kernel, but it doesn't work. How can i get around of it?

Thank you any way.
Joss

Bela Lubkin

unread,
Dec 18, 1997, 3:00:00 AM12/18/97
to

Joss Shen wrote:

> I'm doing a big network driver under Banyan Vines 7.0 (derived from AT&T
> SysV source tree). My problem is: the default 4K stack size is too small
> to my driver, how can i expand it to e.g. 8Kb? Is there any tunable
> parameter could make it done easily?

I *think* the OS you're asking about is SVR3-based. In which case there
is no reasonable way to expand the kernel stack, so you must mend your
ways. Don't consume so much stack. Avoid large local variables. Avoid
true recursion (if you *must* recurse, do it with a loop and a
software-maintained stack). Use kmem_alloc() if it's available.

> Newsgroups: comp.unix.programmer,bit.listserv.banyan-l,comp.unix.sco.programmer,comp.unix.sys5.misc,comp.unix.sys5.r3,comp.unix.sys5.r4,comp.unix.sysv386,comp.unix.solaris

This is way too many newsgroups. Is it an SVR3 or SVR4 kernel? Post to
that group, not the other, not misc, not the really generic groups like
comp.unix.programmer. If it is SVR3-based that you might be right to
post to comp.unix.sco.programmer; if it's SVR4-based then the solaris
group might be appropriate.

>Bela<

--
Sandy & Bela Lubkin are traveling around the world for a year! Telecommuting
from Edinburgh, Scotland; Ireland next. +Please do not Cc: me on news posts!
Our stories and pictures are at: http://www.armory.com/~alexia/trip/trip.html

Joerg Schilling

unread,
Dec 18, 1997, 3:00:00 AM12/18/97
to

In article <34982C99...@activetouch.com>,

Joss Shen <s...@activetouch.com> wrote:
>Hi,
>
>The source code size of the driver is over 10Mb (it's true!). At first,
>it's written to run in WinNT4.0, and it really exceeded NT's 4Kb stack
>limit and make NT down. I don't think i could modify local variables to
>static by my hand and it will produce re-entry problems to functions.

Using static variables would be a very bad idea in kernel software.
Try to alllocate dynamic memory on demand.

>Joerg Schilling wrote:
>>
>> In article <3496CC94...@activetouch.com>,
>> Joss Shen <s...@activetouch.com> wrote:
>> >Hi there,
>> >

>> >I'm doing a big network driver under Banyan Vines 7.0 (derived from AT&T
>> >SysV source tree). My problem is: the default 4K stack size is too small
>> >to my driver, how can i expand it to e.g. 8Kb? Is there any tunable
>> >parameter could make it done easily?
>>

>> Modify your driver so that it does not have too much local (automatic) vars
>> inside the functions. I cannot believe that the 4k limit is is reached because
>> of recursion or procedure calls.

0 new messages