lkml.org 
[lkml]   [2004]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel stack challenge
> Consider rewriting your function to use allocated
> memory instead of stack, this isn't all that hard.

I put LISP interpreter inside the Kernel -
http://vxe.quercitron.com

It works, but it use a lot of stack memory. It's
impossible to rewrite it easily, though I'll
investigate why exactly it uses so much of stack
memory (though it's nature of LISP). There are no
serious kernel memory allocation (as of my interpreter
code review, only function calls; recursions in LISP
application itself are eliminated for sure), but I'll
trace stack usage more thouroughly.

Serge.

--- Helge Hafting <helgehaf@aitel.hist.no> wrote:
> Sergiy Lozovsky wrote:
> > Hi,
> >
> > I have a stack hungry code in the kernel. It hits
> the
> > end of stack from time to time. I wrote function
> to
> > which I pass pointers to function and memory area
> > which should be used as stack for function
> execution.
> > (I just load pointer to new stack area into esp
> > register). This function works just fine in user
> space
> > and memory area provided by me is used as stack.
> >
> > This function doesn't work in the kernel (system
> hungs
> > instantly when my function is called). Does
> antbody
> > have any idea what the reason can be? Some special
> > alignment? Special memory segment? In what
> direction
> > should I look?
> >
> > (sure I tried some magic with alignment like -
> > __attribute__ ((aligned (8192))) - no any effect)
> >
> > (there was some patch to increase stack size
> > kernelwide, but I don't want to affect all the
> > system).
>
>
> You aren't supposed to need much stack for anything
> in the kernel.
> Consider rewriting your function to use allocated
> memory instead of stack, this isn't all that hard.
>
> Helge Hafting
>


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.108 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site