linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Stefani Seibold <stefani@seibold.net>
Cc: Andi Kleen <andi@firstfloor.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: Detailed Stack Information Patch [0/3]
Date: Tue, 31 Mar 2009 21:02:14 +0200	[thread overview]
Message-ID: <20090331190214.GB25879@logfs.org> (raw)
In-Reply-To: <1238523735.3692.30.camel@matrix>

On Tue, 31 March 2009 20:22:15 +0200, Stefani Seibold wrote:
> Am Dienstag, den 31.03.2009, 17:49 +0200 schrieb Andi Kleen:
> > Stefani Seibold <stefani@seibold.net> writes:
> 
> > > - Misuse the thread stack for big temporary data buffers
> > 
> > That would be better checked for at compile time
> > (except for alloca, but that is quite rare)
> 
> Fine but it did not work for functions like:
> 
> void foo(int n)
> {
> 	char buf[n*1024];
> 
> }
> 
> This is valid with gcc.

Good call.  checkstack should look for those as well.  It is certainly
possible to detect statically and warn about:

  10:   29 c4                   sub    %eax,%esp

Runaway recursions are a different matter, though.  The code I once had
to detect them depends on an old version of smatch, which in turn
depends on gcc 3.1.  And even assuming this was in a reasonable shape, I
still don't know what to do about it.  The kernel has thousands of
recursions and trying to work out how deep each one may stack is a
never-ending project.

JA?rn

-- 
A quarrel is quickly settled when deserted by one party; there is
no battle unless there be two.
-- Seneca

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-03-31 19:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 14:58 Stefani Seibold
2009-03-31 15:49 ` Andi Kleen
2009-03-31 18:22   ` Stefani Seibold
2009-03-31 19:02     ` Jörn Engel [this message]
2009-03-31 20:30     ` Andi Kleen
2009-03-31 21:25       ` Stefani Seibold

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=20090331190214.GB25879@logfs.org \
    --to=joern@logfs.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=stefani@seibold.net \
    /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