All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: junkio@cox.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Port SquashFS to 2.6
Date: Tue, 22 Jul 2003 12:16:23 +0200	[thread overview]
Message-ID: <20030722101623.GB29430@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <7vd6g3uvbc.fsf@assigned-by-dhcp.cox.net>

On Mon, 21 July 2003 19:52:39 -0700, junkio@cox.net wrote:
> >>>>> "JE" == JörnEngel  <joern@wohnheim.fh-wedel.de> writes:
>
> JE> Depending on where and what you do,...
> 
> Well, isn't asking about address_space_operations.readpage
> specific enough?

Not for someone as lazy as me.  If you want to know for sure:
- Figure out all possible path leading to that function.
- Figure out all possible path called by that function.
- Sum up all the stack allocated variable size for both.
- Add the architecture-specific function call overhead, multiplied
  by the number of functions on both paths.

Now you have the stack consumption that you were not responsible for,
which depends on the architecture.  Substract that number from the
total stack size, which is also architecture-specific and you know how
much is left.  It is a lot of work and the hard part is finding all
the possible paths.  If you have a good idea how to automate that,
please tell me.  Else, we have to live with rules of thumb.

> JE> ... also depends a bit on the architecture.  s390 has
> JE> giant stacks because function call overhead is huge, ...
> 
> The discussion was about putting variables (or arrays or large
> structs) the kernel programmer defines on the stack, and I do
> not think architecture calling convention has much to do with
> this.
> 
> If an architecture has a big stack usage per call that is
> imposed by the ABI, and larger kernel stack is allocated
> compared to other architectures because of this reason,
> shouldn't there be about the same amount of usable space left
> for the kernel programs within the allocated per-process kernel
> stack space to use?  If that is not the case then the port to
> that particular architecture would not be optimal, wouldn't it?

You end up with all sorts of architecture dependent stuff when
allocating stack.  A long is 4 or 8 bytes, same for pointers, the
amount and size of saved registers differs, the size of the stack
differs, some architectures have a seperate interrupt stack.

If you look closely at the kernel, there is currently no way of
telling whether it contains stack overflows waiting to happen, or not.
We live with lots of hope and the comforting feeling that there were
not many stack overflows in the past.  I wish we had better tools, but
we don't.

Jörn

-- 
The cheapest, fastest and most reliable components of a computer
system are those that aren't there.
-- Gordon Bell, DEC labratories

  parent reply	other threads:[~2003-07-22 10:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.k0do8p6.ch6pps@ifi.uio.no>
     [not found] ` <fa.hre90bn.e6k5pf@ifi.uio.no>
2003-07-22  2:52   ` [PATCH] Port SquashFS to 2.6 junkio
2003-07-22  3:42     ` Valdis.Kletnieks
2003-07-22 10:20       ` Jörn Engel
2003-07-22 10:16     ` Jörn Engel [this message]
2003-07-22 10:36 John Bradford
2003-07-22 10:47 ` Jörn Engel
  -- strict thread matches above, loose matches on Subject: below --
2003-07-19 22:59 junkio
2003-07-19 23:35 ` David Dillow
2003-07-20  5:40   ` junkio
2003-07-20  8:22     ` Jörn Engel
2003-07-20 10:16       ` postmaster
2003-07-20 10:38         ` Jörn Engel
2003-07-20  1:50 ` Bernd Eckenfels

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=20030722101623.GB29430@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=junkio@cox.net \
    --cc=linux-kernel@vger.kernel.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.