public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: "linux-os \(Dick Johnson\)" <linux-os@analogic.com>
Cc: "Linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: 4k stacks
Date: Sat, 24 Dec 2005 14:03:38 +0200	[thread overview]
Message-ID: <200512241403.38482.vda@ilport.com.ua> (raw)
In-Reply-To: <Pine.LNX.4.61.0512221640490.8179@chaos.analogic.com>

On Thursday 22 December 2005 23:53, linux-os (Dick Johnson) wrote:
> 
> Yesterday I sent a patch to add stack-poison so the stack usage
> could be observed.
> 
> Today I wrote a small program and tested the stack usage. Both
> the program and the patch is attached. The result is:
> 
> Offset : 2ec8f000	Available Stack bytes = 3104
> Offset : 2ecb1000	Available Stack bytes = 3104
> Offset : 2ee5f000	Available Stack bytes = 20
> Offset : 2f36d000	Available Stack bytes = 3104
> Offset : 2fd09000	Available Stack bytes = 3012
> Offset : 2fd0b000	Available Stack bytes = 3312
> Offset : 2fd0f000	Available Stack bytes = 2132
> Offset : 2fd2f000	Available Stack bytes = 2744
> Offset : 2fd57000	Available Stack bytes = 2900
> Offset : 2fdd5000	Available Stack bytes = 1400
> Offset : 2fe35000	Available Stack bytes = 2832
> Offset : 2ff3f000	Available Stack bytes = 776
> Offset : 2ff45000	Available Stack bytes = 3188
> 
> This, after compiling the kernel. I did not have 4k stacks
> enabled for this test so any crashing of the stack beyond
> one page will not hurt the system. This was on linux-2.6.13.4.
> 
> Anyway, I tried to enable 4k stacks and the machine would
> not boot past trying to install the first module. It just
> stopped with the interrupts disabled. So, I am now rebuilding
> the kernel back as I write this. That's why I am using 2.6.13
> at the moment.
> 
> Anyway, getting down to 20 bytes of stack-space available
> seems to be pretty scary.

+       movl    %esp, %edi
+       movl    %edi, %ecx
+       andl    $~0x1000, %edi
+       subl    %edi, %ecx

ecx will be equal to ?

+       movb    $'Q', %al
+       rep     stosb
--
vda

  parent reply	other threads:[~2005-12-24 12:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-22 21:53 4k stacks linux-os (Dick Johnson)
2005-12-23  1:11 ` Grant Coady
2005-12-23 17:45   ` Alistair John Strachan
2005-12-23 12:56 ` Krzysztof Halasa
2005-12-24 12:03 ` Denis Vlasenko [this message]
2005-12-25  2:43   ` Andrew James Wade
2005-12-26  7:42     ` Andrew James Wade
2005-12-26  8:40       ` Andrew James Wade
2005-12-27 21:12         ` Frank Sorenson
2005-12-28 18:05           ` Grant Coady
2005-12-26 14:38       ` Diego Calleja
2005-12-28 13:14   ` linux-os (Dick Johnson)
2005-12-28 15:16     ` Denis Vlasenko
2005-12-30 14:45       ` linux-os (Dick Johnson)

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=200512241403.38482.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@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