All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jakub Nowacki <j.s.nowacki@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Stack size of created task
Date: Wed, 13 Jul 2011 20:04:51 +0200	[thread overview]
Message-ID: <4E1DDE43.3030000@domain.hid> (raw)
In-Reply-To: <4E1D9A14.5040901@domain.hid>

On 07/13/2011 03:13 PM, Jakub Nowacki wrote:
> As I understand it is related 
> to the amounts of memory being used by a task, which is put on the stack 
> during task switching, am I right?

Not really. When a function starts, it reserves some room on stack,
mainly for local variables that can not be put in registers (because not
enough registers are available, or for other reasons, such as the fact
that the address of the variable needs to be passed to another function).

When this function calls another function, this other function reserves
room on top of the first stack reserved room, hence the name "stack".

The worst case is the highest level, it may be due to too many functions
reserving little space on stack, or to one function reserving too much
room on stack. For most functions, you can easily measure how much they
reserve on stack by looking at their disassembly. I guess there are perl
scripts around to edit a report of the stack usage of each function in a
binary.

-- 
                                                                Gilles.


      reply	other threads:[~2011-07-13 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 11:37 [Xenomai-help] Stack size of created task Jakub Nowacki
2011-07-13 11:43 ` Gilles Chanteperdrix
2011-07-13 13:13   ` Jakub Nowacki
2011-07-13 18:04     ` Gilles Chanteperdrix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E1DDE43.3030000@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=j.s.nowacki@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.