public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Gerd Knorr <kraxel@bytesex.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: reducing stack usage in v4l?
Date: Wed, 5 Mar 2003 09:35:34 +0000	[thread overview]
Message-ID: <20030305093534.A8883@flint.arm.linux.org.uk> (raw)
In-Reply-To: <87u1eigomv.fsf@bytesex.org>; from kraxel@bytesex.org on Wed, Mar 05, 2003 at 10:15:52AM +0100

On Wed, Mar 05, 2003 at 10:15:52AM +0100, Gerd Knorr wrote:
> But when looking at the disasm output it is obvious that it isn't true
> (at least with gcc 3.2).  On the other hand it is common practice in
> many drivers, there must be a reason for that, no?  Any chance this
> used to work with older gcc versions?

I don't believe so - I seem to remember looking at gcc 2.95 and finding
the same annoying behaviour.

> Not sure what is the best idea to fix that.  Don't like the kmalloc
> idea that much.  The individual structs are not huge, the real problem
> is that many of them are allocated and only few are needed.  Any
> chance to tell gcc that it should allocate block-local variables at
> the start block not at the start of the function?

Not a particularly clean idea, but maybe creating a union of the
structures and putting that on the stack? (ie, doing what GCC should
be doing in the first place.)

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  reply	other threads:[~2003-03-05  9:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-05  5:25 reducing stack usage in v4l? Randy.Dunlap
2003-03-05  5:43 ` Andrew Morton
2003-03-05  9:15 ` Gerd Knorr
2003-03-05  9:35   ` Russell King [this message]
2003-03-05 15:34     ` Randy.Dunlap
2003-03-05 21:40       ` Jörn Engel
2003-03-11  4:27       ` Randy.Dunlap
2003-03-11  9:19         ` Gerd Knorr
2003-03-11 16:29           ` Alan Cox
2003-03-11 15:36             ` Daniel Jacobowitz
2003-03-05 11:50   ` mdew
2003-03-05 12:28     ` Gerd Knorr

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=20030305093534.A8883@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=kraxel@bytesex.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox