Re: Kernel thread stack usage




On Nov 11, 2007, at 12:43 PM, Alexander Motin wrote:

Marcel Moolenaar wrote:
This is not theoretical at all: On ia64 there are 2 stacks. One
growing down and one growing up. The downward stack is used for
stack-based variables and the pward growing stack is used by
the processor for stacked registers.

Hmm, interesting. And which one is pointed by td_kstack there? Or they are using same segment but from opposite sides?

The latter. The td_kstack variable points to the bottom,
which is where the register stack starts. The memory stack
start from td_kstack + td_kstack_size.

The code suggested will not be meaningful on ia64.

Why? If variable stack growing down and it's segment is pointed by td_kstack then where is the problem? Or you mean that system will die earlier when those two stacks in same segment will reach each other?

It's the register stack that grows faster in general and
yes, they grow towards each other so they can eventually
run into each other.

--
Marcel Moolenaar
xcllnt@xxxxxxx


_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Kernel thread stack usage
    ... growing down and one growing up. ... stack-based variables and the pward growing stack is used by ... If variable stack growing down and it's segment is pointed by td_kstack then where is the problem? ...
    (freebsd-arch)
  • Re: how big can automatic (stack) arrays be
    ... pre-translated and faults are still used to grow the stack. ... was that unlike Solaris on Sparc (and Linux on PC, I think), the ... less the same memory layout, with the heap growing up, and the ...
    (comp.unix.programmer)
  • Re: Kernel thread stack usage
    ... growing down and one growing up. ... stack-based variables and the pward growing stack is used by ... If variable stack growing down and it's segment is pointed by td_kstack then where is the problem? ...
    (freebsd-arch)
  • Re: how big can automatic (stack) arrays be
    ... pre-translated and faults are still used to grow the stack. ... Some details regarding HP-UX address space layout are available here: ... All variants employ a downward growing 'memory stack' and an upward ...
    (comp.unix.programmer)
  • Re: variable allocated from stack/bss ??
    ... jacob navia wrote: ... stack and no bss. ... I have programmed on an implementation with no stack-based variables ...
    (comp.lang.c)