Re: [patch] larger kernel stack (8k->16k) per task (fwd)

From: Balbir Singh (balbir_soni@hotmail.com)
Date: Fri Feb 08 2002 - 15:42:02 EST


Modified the patch to fix smpboot.c and traps.c
vmlinux.lds and sched.h need not be fixed. The
size of INIT_TASK is still 8K, so that other
architectures using 8K stacks are not hurt.

This is a patch specific to i386. Its main use is to debug
kernel code which causes an overflow of the kernel stack.
It is highly recommended to use the existing stack size of
8KB, increasing the stack size to 16KB with an 200
processes running on an average causes 1.5MB of
extra memory to be used.

I have tested this patch on my desktop to my satisfaction.
I do not think that this affects an SMP system. Testing on
an SMP box and reporting Bugs and/or success of the patch
would be highly appreciated.

The patch is included as an attachment along with this
email.

>
>Hi Balbir,
>
>On Fri, 8 Feb 2002, Balbir Singh wrote:
> > 2. I think you missed getuser.S in arch/i386/kernel/lib.
> > All the __get_user_x should change to
>
>no, I didn't miss them. If you read the patch again you will see them.
>
> >
> > 3. I verified that the instance of GET_CURRENT in hw-irq.h
> > is not being used by anybody and can safely be removed.
>
>yes, I also verified and came to the same conclusion but left the change
>in the patch on purpose (so if anyone does start using it, it is already
>correct)
>
> >
> > __get_user_1:
> > movl %esp,%edx
> > andl $~(THREAD_SIZE - 1),%edx
> > cmpl addr_limit(%edx),%eax
> >
> > I have a patch that lets the user select any stack size
> > from 8K to 64K, it can be configured. And yes, it works
> > on my system.
> >
> > I do not have the /proc entry that u have though in
> > my patch.
> >
> > Would you like to merge both the patches or would you
> > like me to do it and send out a new version.
> >
> >
> > The patch is attached along with this email. It
> > is againt 2.4.17
>
>The serious problem with your patch is that you missed quite a few places
>(e.g. smpboot.c and traps.c). Most importantly, you missed the alignment
>in vmlinux.lds so I guess your machine boots by pure luck :) In the early
>stages (first hours of writing it) I missed that one too and was puzzled
>by random panics on boot...
>
>Actually, the patch I sent is only part of the "complete piece", the other
>part being changes to kdb to work correctly with large stack. I can
>separate those from kdb patch that I use and send out if there was enough
>interest.
>
>Regards,
>Tigran
>

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com



-
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/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:22 EST