Re: Kernel thread stack usage




On Nov 12, 2007, at 11:06 AM, Alexander Motin wrote:

For i386 platform we have registers pointing current stack head. To simplify my example I have used address of local variable for that. Probably for ia64 we should just use one more register or algorithm to take into account second stack growing upward.

Remember that taking the address of a local variable automatically
prevents that variable from being register-promoted. As such, it
increases stack pressure :-)

I think GCC has an intrinsic to get the current frame pointer. You
may want to use that instead. Granted, this would not help ia64,
but it's better than taking the address of a local variable. For
ia64 you can do as you suggest and add a second "algorithm". This
means you probably want to make it machine specific in the first
place (i.e. add a MD function that returns an approximation of the
number of bytes of stack space in use).

--
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: 2.6.20-rc7: known regressions
    ... + * Wrap all the virtual calls in a way that forces the parameters on the stack. ... Then you wouldn't need all that ugly casting. ... ia64 already has such wrapper ...
    (Linux-Kernel)
  • Re: Add prefetch switch stack hook in scheduler function
    ... >minimum stack footprint' is larger, ... Surely the prefetch range has to depend on which direction the stack ... BTW, for ia64 you may as well prefetch pt_regs, that is also quite ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Intel 64 bit Pentium seems to be on its way
    ... The IA64 has, and will continue to have *leading* FP performance, and near ... AMD - the chip isn't a desktop chip, it's really a 2-4 way server chip - ... > The register recently reported that a grand total of ... >> sheet ended at the same point as the arrow of the Alpha's. ...
    (comp.os.vms)
  • [PATCH sched-devel 4/7] cpuisol: Move on-stack array used for boot cmd parsing into __initda
    ... will consume 4k of stack on ia64. ... We'll just squeak through ... for a ittle while, but this needs to be fixed. ...
    (Linux-Kernel)
  • Re: HPUX Stack Structure
    ... The ia64 is rather important.. ... you'll see that ia64 uses a Register Stack Engine model. ... as registers by your compiler.. ...
    (comp.sys.hp.hpux)