Re: kernel stack size

2001-08-17 Thread Warner Losh
In message <[EMAIL PROTECTED]> Julian Elischer writes: : We may go to 2 pages but really 1 page is enough as long as people : don't store structures on the stack. It's been kept small to keep the : overhead of processes and threads down. When we get threads (KSE) we may : have theoretically thou

Re: kernel stack size

2001-08-17 Thread Julian Elischer
We may go to 2 pages but really 1 page is enough as long as people don't store structures on the stack. It's been kept small to keep the overhead of processes and threads down. When we get threads (KSE) we may have theoretically thousands more of these, on potentially smaller boxes.. The main po

Re: kernel stack size

2001-08-17 Thread Eugene L. Vorokov
> In 5-0-KSE there is a single page that contains the stack and > the PCB (which is about 660 bytes). We are also looking at adding > code to set a hardware watchpoint between the stack and the PCB > to catch overruns. Maybe I'm just dumb, but I still don't understand, what is the reason of keep

Re: kernel stack size

2001-08-15 Thread Julian Elischer
Weiguang SHI wrote: > > A closer look at the code /usr/src/sys/i386/i386/locore.s astonished > me with the fact that the kernel stack size for a process, at least > for process 0, is 2*4096-sizeof(struct user) = 3988 bytes, less than > even one page. > > Anyone to verify this, please? > BTW, I a

Re: Kernel stack size

2001-08-08 Thread Mike Smith
> I'm developing some code running in kernel that use a lot of stack. And it > seems i run into stack overflow. This results in some proc structure > related parts overwrite (particulary p->p_stats->p_timer[ITIMER_PROF]) and > unexpected signals. (Otherwise, it usually page faults inside > swi_net

Re: Kernel stack size

2001-08-07 Thread Julian Elischer
CTED]> > >To: "Semen A. Ustimenko" <[EMAIL PROTECTED]> > >CC: [EMAIL PROTECTED] > >Subject: Re: Kernel stack size > >Date: Tue, 7 Aug 2001 13:29:25 -0700 (PDT) > > > > > > > >On Wed, 8 Aug 2001, Semen A. Ustimenko wrote:

Re: Kernel stack size

2001-08-07 Thread Weiguang SHI
>From: Julian Elischer <[EMAIL PROTECTED]> >To: "Semen A. Ustimenko" <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: Kernel stack size >Date: Tue, 7 Aug 2001 13:29:25 -0700 (PDT) > > > >On Wed, 8 Aug 2001, Semen A. Ustimenko wrote: >

Re: Kernel stack size

2001-08-07 Thread Terry Lambert
Julian Elischer wrote: > > the kernel stack is a VERY LIMITED resource > basically you have about 4 or 5 Kbytes per process. > if you overflow it you write over your signal information.. > > you should MALLOC space and use a pointer to it.. Would adding an unmapped or read-only guard page be un

Re: Kernel stack size

2001-08-07 Thread Julian Elischer
On Wed, 8 Aug 2001, Semen A. Ustimenko wrote: > Hi! Thanks for light speed response! > > On Tue, 7 Aug 2001, Julian Elischer wrote: > > > the kernel stack is a VERY LIMITED resource > > basically you have about 4 or 5 Kbytes per process. > Oops... And there is no hope to enlarge it? none rea

Re: Kernel stack size

2001-08-07 Thread Semen A. Ustimenko
Hi! Thanks for light speed response! On Tue, 7 Aug 2001, Julian Elischer wrote: > the kernel stack is a VERY LIMITED resource > basically you have about 4 or 5 Kbytes per process. Oops... And there is no hope to enlarge it? > if you overflow it you write over your signal information.. > That's

Re: Kernel stack size

2001-08-07 Thread Julian Elischer
the kernel stack is a VERY LIMITED resource basically you have about 4 or 5 Kbytes per process. if you overflow it you write over your signal information.. you should MALLOC space and use a pointer to it.. On Wed, 8 Aug 2001, Semen A. Ustimenko wrote: > Hi! > > I'm developing some code runnin

Re: kernel stack size

2001-07-27 Thread Gersh
The kernel will grow the size of the userland stack if need be. Look for vm_map_growstack(). Also just a FYI that size sounds about right for the kernel stack. Be very careful not to use function recursion or to many on the stack large sized variables or else youll blow yourself into double faul

Re: kernel stack size?

2000-11-08 Thread Jacques Fourie
--- Matt Dillon <[EMAIL PROTECTED]> wrote: > You can theoretically increase UPAGES in > /usr/src/sys/i386/include/param.h I increased UPAGES from 2 to 8 and everything seems to be working as it should. The device in question will very much be a dedicated IPsec device and will not be running t

Re: kernel stack size?

2000-11-08 Thread Jacques Fourie
--- Julian Elischer <[EMAIL PROTECTED]> wrote: > Why are you not using the netgraph system, which was > specifically > designed > for this? it allows you to divert eherne packets When we started on this, (~2years ago) I was not aware of the netgraph functionality. I agree that it would be better

Re: kernel stack size?

2000-11-08 Thread Julian Elischer
Jacques Fourie wrote: > > Hi > > Please excuse any silly questions, but I am stuck with > a problem that I can't find the answer for. > > I wrote a KLD module that performs encryption on > network packets in the kernel. Packets are intercepted > for encryption on a ethernet level (in ether_inpu

Re: kernel stack size?

2000-11-08 Thread Daniel C. Sobral
Jacques Fourie wrote: > > Would it be possible to pre-allocate a block of memory > and then "switch" stacks in my interrupt routine? This > may be far off, but my only other option is going > through ~1 lines of code and examining all places > where local variables are declared. If I could so

Re: kernel stack size?

2000-11-08 Thread Matt Dillon
: : :Would it be possible to pre-allocate a block of memory :and then "switch" stacks in my interrupt routine? This :may be far off, but my only other option is going :through ~1 lines of code and examining all places :where local variables are declared. If I could somehow :do this in a diffe

Re: kernel stack size?

2000-11-08 Thread Jacques Fourie
First of all, I would like to say a big thanks for all of the replies I got so far. I really appreciate it. Here is a more detailed description of what the code does. It is for a commercial IPsec product. I know that IPsec is available in FreeBSD, but this started long before KAME was available.

Re: kernel stack size?

2000-11-08 Thread Mike Smith
> > --- Warner Losh <[EMAIL PROTECTED]> wrote: > > > 10k lines in an interrupt routine sounds to be way > > more work than you > > want to do in an interrupt routine. Maybe you could > > use a work queue > > and deal with it that way. There isn't much I can > > The ~10k lines of code is in a

Re: kernel stack size?

2000-11-08 Thread Jacques Fourie
--- Warner Losh <[EMAIL PROTECTED]> wrote: > 10k lines in an interrupt routine sounds to be way > more work than you > want to do in an interrupt routine. Maybe you could > use a work queue > and deal with it that way. There isn't much I can The ~10k lines of code is in a software interrupt (

Re: kernel stack size?

2000-11-08 Thread Warner Losh
In message <[EMAIL PROTECTED]> Jacques Fourie writes: : Would it be possible to pre-allocate a block of memory : and then "switch" stacks in my interrupt routine? This : may be far off, but my only other option is going : through ~1 lines of code and examining all places : where local variable

Re: kernel stack size?

2000-11-08 Thread Jacques Fourie
Would it be possible to pre-allocate a block of memory and then "switch" stacks in my interrupt routine? This may be far off, but my only other option is going through ~1 lines of code and examining all places where local variables are declared. If I could somehow do this in a different way,

Re: kernel stack size?

2000-11-08 Thread Matt Dillon
: :Hi : :Thanks for your reply. I have two other questions :regarding this matter. : :Would it be possible to extend the kernel stack? :The reason is that some of the crypto and hashing :algorithms use relatively large contexts which for :performance reasons are currently allocated on the :stack.

Re: kernel stack size?

2000-11-07 Thread Jacques Fourie
Hi Thanks for your reply. I have two other questions regarding this matter. Would it be possible to extend the kernel stack? The reason is that some of the crypto and hashing algorithms use relatively large contexts which for performance reasons are currently allocated on the stack. If this is

Re: kernel stack size?

2000-11-07 Thread Matt Dillon
:Hi : :Please excuse any silly questions, but I am stuck with :a problem that I can't find the answer for. : :I wrote a KLD module that performs encryption on :network packets in the kernel. Packets are intercepted :for encryption on a ethernet level (in ether_input() :and ether_output_frame() re