linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] x86 transition to 4k stacks (0/3)
@ 2002-10-15  5:59 Dave Hansen
  2002-10-15 15:10 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Hansen @ 2002-10-15  5:59 UTC (permalink / raw)
  To: linux-kernel

The kernel currently uses an 8k stack, per task.  Here is the 
infrastructure needed to allow us to halve that at some point in the 
future.

This is a port of work Ben LaHaise did around 2.5.20 time.  I split it
up and updated it for the new preempt_count semantics.

I split the original patch up into 3 pieces (apply in this order):
* clean thread info infrastructure (1/3)
   - take out all instances of things like (8191&addr) to get
     current stack address.
* stack checking (3/3)
   - use gcc's profiling features to check for stack overflows upon
     entry to functions.
   - Warn if the task goes over 4k.
   - Panic if the stack gets within 512 bytes of overflowing.
* interrupt stacks (3/3)
   - allocate per-cpu interrupt stacks.  upon entry to
     common_interrupt, switch to the current cpu's stack.
   - inherit the interrupted task's preempt count

Any suggestions on how to deal with "gcc -p" and old, buggy versions
of gcc would be appreciated.
-- 
Dave Hansen
haveblue@us.ibm.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC][PATCH] x86 transition to 4k stacks (0/3)
  2002-10-15  5:59 [RFC][PATCH] x86 transition to 4k stacks (0/3) Dave Hansen
@ 2002-10-15 15:10 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-10-15 15:10 UTC (permalink / raw)
  To: Dave Hansen; +Cc: linux-kernel

On Mon, Oct 14, 2002 at 10:59:55PM -0700, Dave Hansen wrote:
> The kernel currently uses an 8k stack, per task.  Here is the 
> infrastructure needed to allow us to halve that at some point in the 
> future.
> 
> This is a port of work Ben LaHaise did around 2.5.20 time.  I split it
> up and updated it for the new preempt_count semantics.
> 
> I split the original patch up into 3 pieces (apply in this order):
> * clean thread info infrastructure (1/3)
>   - take out all instances of things like (8191&addr) to get
>     current stack address.
> * stack checking (3/3)
>   - use gcc's profiling features to check for stack overflows upon
>     entry to functions.
>   - Warn if the task goes over 4k.
>   - Panic if the stack gets within 512 bytes of overflowing.
> * interrupt stacks (3/3)
>   - allocate per-cpu interrupt stacks.  upon entry to
>     common_interrupt, switch to the current cpu's stack.
>   - inherit the interrupted task's preempt count
> 
> Any suggestions on how to deal with "gcc -p" and old, buggy versions
> of gcc would be appreciated.

You might have better luck with -finstrument-functions; I don't know if
it is supported as far back but I don't believe it was buggy.  It has a
few fewer quirks than mcount profiling.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-15 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15  5:59 [RFC][PATCH] x86 transition to 4k stacks (0/3) Dave Hansen
2002-10-15 15:10 ` Daniel Jacobowitz

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).