linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Jonathan Lundell <linux@lundell-bros.com>
Cc: root@chaos.analogic.com, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: top stack (l)users for 2.5.69
Date: Wed, 7 May 2003 19:55:31 +0200	[thread overview]
Message-ID: <20030507175531.GF19324@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <p05210601badeeb31916c@[207.213.214.37]>

On Wed, 7 May 2003 10:13:55 -0700, Jonathan Lundell wrote:
> At 10:16am -0400 5/7/03, Richard B. Johnson wrote:
> >Nope. Just don't steal thousands of CPU cycles to make something
> >"pretty". Obviously something called recursively with a 2k buffer
> >on the stack is going to break. However one has to actually
> >look at the code and determine the best (if any) way to reduce
> >stack usage. For instance, some persons may just "like" 0x400 for
> >the size of a temporary buffer when, in fact, 29 bytes are actually
> >used.
> >
> >FYI, one can make a module that will show the maximum amount
> >of stack ever used IFF the stack gets zeroed before use upon
> >kernel startup. Would this be useful or has it already been
> >done?
> 
> There's at least one patch floating around to do that; we've used it 
> to help track down some stack overflow problems.

Do you have a URL or can you post that patch? Sounds very useful for
information gathering.

> Does 2.5 use a separate interrupt stack? (Excuse my ignorance; I 
> haven't been paying attention.) Total stack-page usage in the 2.4 
> model, at any rate, is the sum of the task struct, the usage of any 
> task-level thread (system calls, pretty much), any softirq (including 
> the network protocol & routing handlers, and any netfilter modules), 
> and some number of possibly-nested hard interrupts.

Depends on the architecture. s390 does, ppc didn't as of 2.4.2, the
rest I'm not sure about. But this is another requirement for stack
reduction to 4k for most platforms, if not all.

> One thing that would help (aside from separate interrupt stacks) 
> would be a guard page below the stack. That wouldn't require any 
> physical memory to be reserved, and would provide positive indication 
> of stack overflow without significant runtime overhead.

Yes, that should work. It needs some additional code in the page fault
handler to detect this case, but that shouldn't slow the system down
too much.

Jörn

-- 
And spam is a useful source of entropy for /dev/random too!
-- Jasmine Strong

  parent reply	other threads:[~2003-05-07 17:43 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07 13:20 top stack (l)users for 2.5.69 Jörn Engel
2003-05-07 13:45 ` Richard B. Johnson
2003-05-07 13:56   ` Jörn Engel
2003-05-07 14:16     ` Richard B. Johnson
2003-05-07 17:13       ` Jonathan Lundell
2003-05-07 17:40         ` Richard B. Johnson
2003-05-07 18:12           ` Roland Dreier
2003-05-07 18:28             ` Richard B. Johnson
2003-05-07 18:44               ` Timothy Miller
2003-05-07 18:46               ` Roland Dreier
2003-05-07 19:30                 ` Richard B. Johnson
2003-05-07 19:42                   ` Roland Dreier
2003-05-07 20:04                     ` Richard B. Johnson
2003-05-07 20:23                       ` Roland Dreier
2003-05-07 20:42                       ` Timothy Miller
2003-05-08  9:06                         ` Jörn Engel
2003-05-08 11:33                         ` Richard B. Johnson
2003-05-08 12:00                           ` Helge Hafting
2003-05-08 15:42                           ` Timothy Miller
2003-05-09  8:57                             ` Miles Bader
2003-05-09 16:50                               ` Timothy Miller
2003-05-08 16:47                           ` Davide Libenzi
2003-05-07 18:51               ` Davide Libenzi
2003-05-07 19:22                 ` Richard B. Johnson
2003-05-07 19:31                   ` Davide Libenzi
2003-05-07 19:39                   ` Hua Zhong
2003-05-07 21:47                 ` Martin J. Bligh
2003-05-08 10:29           ` David Howells
2003-05-07 17:55         ` Jörn Engel [this message]
2003-05-07 16:20           ` Martin J. Bligh
2003-05-07 19:01         ` Dave Hansen
2003-05-07 20:06           ` Jörn Engel
2003-05-07 20:14             ` Dave Hansen
2003-05-08  8:41               ` Jörn Engel
2003-05-08 16:51                 ` Dave Hansen
2003-05-08 22:12                   ` Jörn Engel
2003-05-07 21:30         ` Jesse Pollard
2003-05-07 21:54           ` Timothy Miller
2003-05-07 22:01             ` Jesse Pollard
2003-05-07 14:33     ` Torsten Landschoff
2003-05-07 14:47       ` William Lee Irwin III
2003-05-07 15:04         ` Torsten Landschoff
2003-05-07 16:01           ` William Lee Irwin III
2003-05-08 15:36             ` Ingo Oeser
2003-05-08 18:04               ` William Lee Irwin III
2003-05-07 15:23         ` Timothy Miller
2003-05-07 15:47           ` William Lee Irwin III
2003-05-07 16:49         ` Jörn Engel
2003-05-07 17:18           ` Davide Libenzi
2003-05-07 17:40             ` Jörn Engel
2003-05-07 18:35               ` Davide Libenzi
2003-05-07 19:45                 ` Jörn Engel
2003-05-07 18:23             ` William Lee Irwin III
2003-05-07 17:38           ` William Lee Irwin III
2003-05-07 17:47             ` Jörn Engel
2003-05-07 14:49       ` Richard B. Johnson
2003-05-07 18:36   ` Linus Torvalds
2003-05-07 19:17     ` Jeff Garzik
2003-05-07 20:38       ` Randy.Dunlap
2003-05-07 21:27         ` Marcus Alanen
2003-05-07 21:27           ` Randy.Dunlap
2003-05-08 15:10         ` Ingo Oeser
2003-05-08 17:12           ` Randy.Dunlap
2003-05-07 19:38 Chuck Ebbert
2003-05-08 14:08 Chuck Ebbert
2003-05-08 18:04 ` Jonathan Lundell
2003-05-08 19:05   ` Timothy Miller
2003-05-08 21:00     ` Jonathan Lundell

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=20030507175531.GF19324@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@lundell-bros.com \
    --cc=root@chaos.analogic.com \
    /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;
as well as URLs for NNTP newsgroup(s).