mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Jesper Juhl <jesper.juhl@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 4KSTACKS + DEBUG_STACKOVERFLOW harmful
Date: Wed, 29 Aug 2007 19:55:04 -0400	[thread overview]
Message-ID: <0C35E890-6F24-4073-9D29-A7D365DCB136@mac.com> (raw)
In-Reply-To: <46D5FAE5.3020401@redhat.com>

On Aug 29, 2007, at 19:01:57, Eric Sandeen wrote:
> Jesper Juhl wrote:
>> A first step could be to allocate those two char arrays with  
>> kmalloc() instead of on the stack, but then I guess that dump_stack 
>> () gets called from places where we may not really want to be  
>> calling kmalloc(). I guess we could allocate the buffers earlier  
>> (like at boot time) and store pointers somewhere where dump stack  
>> can get to them later when it needs them.
>
> Yep, I thought about something like that... and I assume you'd need  
> a bit of locking around them too.

How about turning off preemption and using a per-CPU buffer?   
Alternatively you could turn off IRQs, poke a per-CPU value to clue  
in any incoming NMIs, and switch to a separate stack.  I suppose if  
you wanted it to work with all of 16 bytes of stack left on both  
thread and IRQ stacks, you could have separate per-CPU NMI stacks;  
the stack-dump would be poking a special per-CPU value and sending  
ourselves an NMI.

There are probably a half dozen other variants on ways to run  
screaming to the CPU saying "It hurts mommy!" and get a new stack in  
which we can play for a while.

Cheers,
Kyle Moffett

  reply	other threads:[~2007-08-29 23:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29 22:34 Eric Sandeen
2007-08-29 22:53 ` Jesper Juhl
2007-08-29 23:01   ` Eric Sandeen
2007-08-29 23:55     ` Kyle Moffett [this message]
2007-08-31 11:11 ` Denys Vlasenko
2007-08-31 14:35   ` Jörn Engel
2007-08-31 17:16     ` Denys Vlasenko
2008-05-28 14:36 ` Mike Snitzer
2008-05-28 15:13   ` Eric Sandeen

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=0C35E890-6F24-4073-9D29-A7D365DCB136@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@redhat.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

all inboxes | Powered by JetHome®