2006-01-04 14:51:40

by Adrian Bunk

[permalink] [raw]
Subject: [-mm patch] i386: enable 4k stacks by default

This patch enables 4k stacks by default.

4k stacks have become a well-tested feature used fore a long time in
Fedora and even in RHEL 4.

There are no known problems in in-kernel code with 4k stacks still
present after Neil's patch that went into -mm nearly two months ago.

Defaulting to 4k stacks in -mm kernel will give some more testing
coverage and should show whether there are really no problems left.

Keeping the option for now should make the people happy who want to use
the experimental -mm kernel but don't trust the well-tested 4k stacks.


Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
+++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
@@ -53,8 +53,8 @@
If in doubt, say "N".

config 4KSTACKS
- bool "Use 4Kb for kernel stacks instead of 8Kb"
- depends on DEBUG_KERNEL
+ bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
+ default y
help
If you say Y here the kernel will use a 4Kb stacksize for the
kernel stack attached to each process/thread. This facilitates


2006-01-04 16:39:17

by Jesper Juhl

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On 1/4/06, Adrian Bunk <[email protected]> wrote:
> This patch enables 4k stacks by default.
>
> 4k stacks have become a well-tested feature used fore a long time in
> Fedora and even in RHEL 4.
>
> There are no known problems in in-kernel code with 4k stacks still
> present after Neil's patch that went into -mm nearly two months ago.
>
> Defaulting to 4k stacks in -mm kernel will give some more testing
> coverage and should show whether there are really no problems left.
>
> Keeping the option for now should make the people happy who want to use
> the experimental -mm kernel but don't trust the well-tested 4k stacks.
>
>
> Signed-off-by: Adrian Bunk <[email protected]>
>
> --- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
> +++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
> @@ -53,8 +53,8 @@
> If in doubt, say "N".
>
> config 4KSTACKS
> - bool "Use 4Kb for kernel stacks instead of 8Kb"
> - depends on DEBUG_KERNEL
> + bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL

Why "if DEBUG_KERNEL" ?


--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2006-01-04 16:44:47

by Adrian Bunk

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Wed, Jan 04, 2006 at 05:39:14PM +0100, Jesper Juhl wrote:
> On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > This patch enables 4k stacks by default.
> >
> > 4k stacks have become a well-tested feature used fore a long time in
> > Fedora and even in RHEL 4.
> >
> > There are no known problems in in-kernel code with 4k stacks still
> > present after Neil's patch that went into -mm nearly two months ago.
> >
> > Defaulting to 4k stacks in -mm kernel will give some more testing
> > coverage and should show whether there are really no problems left.
> >
> > Keeping the option for now should make the people happy who want to use
> > the experimental -mm kernel but don't trust the well-tested 4k stacks.
> >
> >
> > Signed-off-by: Adrian Bunk <[email protected]>
> >
> > --- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
> > +++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
> > @@ -53,8 +53,8 @@
> > If in doubt, say "N".
> >
> > config 4KSTACKS
> > - bool "Use 4Kb for kernel stacks instead of 8Kb"
> > - depends on DEBUG_KERNEL
> > + bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
>
> Why "if DEBUG_KERNEL" ?

This is simply the same as before with the defaults inverted.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-01-04 16:49:28

by Jesper Juhl

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On 1/4/06, Adrian Bunk <[email protected]> wrote:
> On Wed, Jan 04, 2006 at 05:39:14PM +0100, Jesper Juhl wrote:
> > On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > > This patch enables 4k stacks by default.
> > >
> > > 4k stacks have become a well-tested feature used fore a long time in
> > > Fedora and even in RHEL 4.
> > >
> > > There are no known problems in in-kernel code with 4k stacks still
> > > present after Neil's patch that went into -mm nearly two months ago.
> > >
> > > Defaulting to 4k stacks in -mm kernel will give some more testing
> > > coverage and should show whether there are really no problems left.
> > >
> > > Keeping the option for now should make the people happy who want to use
> > > the experimental -mm kernel but don't trust the well-tested 4k stacks.
> > >
> > >
> > > Signed-off-by: Adrian Bunk <[email protected]>
> > >
> > > --- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
> > > +++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
> > > @@ -53,8 +53,8 @@
> > > If in doubt, say "N".
> > >
> > > config 4KSTACKS
> > > - bool "Use 4Kb for kernel stacks instead of 8Kb"
> > > - depends on DEBUG_KERNEL
> > > + bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
> >
> > Why "if DEBUG_KERNEL" ?
>
> This is simply the same as before with the defaults inverted.
>
I just thought that you wanted to get as much testing in -mm as
possible while still leaving the old stacksize option for those who
don't yet trust 4K stacks.
To get maximum testing making 4KSTACKS default Y and removing the "if
DEBUG_KERNEL" conditional just seems to me to be the obvious choice...

--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2006-01-04 16:58:37

by Adrian Bunk

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Wed, Jan 04, 2006 at 05:49:25PM +0100, Jesper Juhl wrote:
> On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > On Wed, Jan 04, 2006 at 05:39:14PM +0100, Jesper Juhl wrote:
> > > On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > > > This patch enables 4k stacks by default.
> > > >
> > > > 4k stacks have become a well-tested feature used fore a long time in
> > > > Fedora and even in RHEL 4.
> > > >
> > > > There are no known problems in in-kernel code with 4k stacks still
> > > > present after Neil's patch that went into -mm nearly two months ago.
> > > >
> > > > Defaulting to 4k stacks in -mm kernel will give some more testing
> > > > coverage and should show whether there are really no problems left.
> > > >
> > > > Keeping the option for now should make the people happy who want to use
> > > > the experimental -mm kernel but don't trust the well-tested 4k stacks.
> > > >
> > > >
> > > > Signed-off-by: Adrian Bunk <[email protected]>
> > > >
> > > > --- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
> > > > +++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
> > > > @@ -53,8 +53,8 @@
> > > > If in doubt, say "N".
> > > >
> > > > config 4KSTACKS
> > > > - bool "Use 4Kb for kernel stacks instead of 8Kb"
> > > > - depends on DEBUG_KERNEL
> > > > + bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
> > >
> > > Why "if DEBUG_KERNEL" ?
> >
> > This is simply the same as before with the defaults inverted.
> >
> I just thought that you wanted to get as much testing in -mm as
> possible while still leaving the old stacksize option for those who
> don't yet trust 4K stacks.

That is what my patch does.

> To get maximum testing making 4KSTACKS default Y and removing the "if
> DEBUG_KERNEL" conditional just seems to me to be the obvious choice...

With my version, we are getting the bigger testing coverage - and
getting a big testing coverage in -mm is what we need if we want to know
whether we have really already fixed all stack problems or whether
there are any left.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-01-04 17:10:47

by Jesper Juhl

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On 1/4/06, Adrian Bunk <[email protected]> wrote:
> On Wed, Jan 04, 2006 at 05:49:25PM +0100, Jesper Juhl wrote:
> > To get maximum testing making 4KSTACKS default Y and removing the "if
> > DEBUG_KERNEL" conditional just seems to me to be the obvious choice...
>
> With my version, we are getting the bigger testing coverage - and
> getting a big testing coverage in -mm is what we need if we want to know
> whether we have really already fixed all stack problems or whether
> there are any left.
>
Ok, I guess I didn't make myself as clear as I thought.
What I meant was that if 4K stacks are always enabled by default, then
you'll get more testing than if only people who enable DEBUG_KERNEL
are able to turn it on.

So I guess what I'm really aiming at is to either move the option up a
level - that is, remove its dependency on CONFIG_DEBUG_KERNEL, or turn
the option on its head and make it an option to enable 8K stacks
instead and make that option then default to N (I like the first
aproach better though).

Something like this :

--- linux-2.6.15-orig/arch/i386/Kconfig.debug 2006-01-03
04:21:10.000000000 +0100
+++ linux-2.6.15/arch/i386/Kconfig.debug 2006-01-04
19:08:43.000000000 +0100
@@ -44,7 +44,7 @@

config 4KSTACKS
bool "Use 4Kb for kernel stacks instead of 8Kb"
- depends on DEBUG_KERNEL
+ default y
help
If you say Y here the kernel will use a 4Kb stacksize for the
kernel stack attached to each process/thread. This facilitates

--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2006-01-04 17:17:13

by Adrian Bunk

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Wed, Jan 04, 2006 at 06:10:45PM +0100, Jesper Juhl wrote:
> On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > On Wed, Jan 04, 2006 at 05:49:25PM +0100, Jesper Juhl wrote:
> > > To get maximum testing making 4KSTACKS default Y and removing the "if
> > > DEBUG_KERNEL" conditional just seems to me to be the obvious choice...
> >
> > With my version, we are getting the bigger testing coverage - and
> > getting a big testing coverage in -mm is what we need if we want to know
> > whether we have really already fixed all stack problems or whether
> > there are any left.
> >
> Ok, I guess I didn't make myself as clear as I thought.
> What I meant was that if 4K stacks are always enabled by default, then
> you'll get more testing than if only people who enable DEBUG_KERNEL
> are able to turn it on.
>...

This is not what my patch does.

Please apply my patch, use DEBUG_KERNEL=n and you'll understand it.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-01-04 20:53:07

by Grant Coady

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Wed, 4 Jan 2006 15:51:38 +0100, Adrian Bunk <[email protected]> wrote:

>This patch enables 4k stacks by default.
>
>4k stacks have become a well-tested feature used fore a long time in
>Fedora and even in RHEL 4.
>
>There are no known problems in in-kernel code with 4k stacks still
>present after Neil's patch that went into -mm nearly two months ago.
>
>Defaulting to 4k stacks in -mm kernel will give some more testing
>coverage and should show whether there are really no problems left.
>
>Keeping the option for now should make the people happy who want to use
>the experimental -mm kernel but don't trust the well-tested 4k stacks.
>
>
>Signed-off-by: Adrian Bunk <[email protected]>
>
>--- linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug.old 2006-01-04 11:43:55.000000000 +0100
>+++ linux-2.6.15-rc5-mm3-full/arch/i386/Kconfig.debug 2006-01-04 11:44:14.000000000 +0100
>@@ -53,8 +53,8 @@
> If in doubt, say "N".
>
> config 4KSTACKS
>- bool "Use 4Kb for kernel stacks instead of 8Kb"
>- depends on DEBUG_KERNEL
>+ bool "Use 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
>+ default y
> help
> If you say Y here the kernel will use a 4Kb stacksize for the
> kernel stack attached to each process/thread. This facilitates

Perhaps mention 4k + 4k stacks, the separate irq stacks used with 4k option?

Grant.

2006-01-04 21:01:14

by Adrian Bunk

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Thu, Jan 05, 2006 at 07:53:00AM +1100, Grant Coady wrote:
> On Wed, 4 Jan 2006 15:51:38 +0100, Adrian Bunk <[email protected]> wrote:
>...
> > If you say Y here the kernel will use a 4Kb stacksize for the
> > kernel stack attached to each process/thread. This facilitates
>
> Perhaps mention 4k + 4k stacks, the separate irq stacks used with 4k option?

Feel free to submit a patch. ;-)

> Grant.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-01-04 21:56:55

by Jesper Juhl

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On 1/4/06, Adrian Bunk <[email protected]> wrote:
> On Wed, Jan 04, 2006 at 06:10:45PM +0100, Jesper Juhl wrote:
> > On 1/4/06, Adrian Bunk <[email protected]> wrote:
> > > On Wed, Jan 04, 2006 at 05:49:25PM +0100, Jesper Juhl wrote:
> > > > To get maximum testing making 4KSTACKS default Y and removing the "if
> > > > DEBUG_KERNEL" conditional just seems to me to be the obvious choice...
> > >
> > > With my version, we are getting the bigger testing coverage - and
> > > getting a big testing coverage in -mm is what we need if we want to know
> > > whether we have really already fixed all stack problems or whether
> > > there are any left.
> > >
> > Ok, I guess I didn't make myself as clear as I thought.
> > What I meant was that if 4K stacks are always enabled by default, then
> > you'll get more testing than if only people who enable DEBUG_KERNEL
> > are able to turn it on.
> >...
>
> This is not what my patch does.
>
> Please apply my patch, use DEBUG_KERNEL=n and you'll understand it.
>
I see now what it is your patch does. I misread it - sorry - should
have just downloaded it and tried it.
It does exactely what I thought it didn't do - I like it :-)


--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2006-01-04 22:24:31

by Grant Coady

[permalink] [raw]
Subject: Re: [-mm patch] i386: enable 4k stacks by default

On Wed, 4 Jan 2006 22:00:45 +0100, Adrian Bunk <[email protected]> wrote:

>On Thu, Jan 05, 2006 at 07:53:00AM +1100, Grant Coady wrote:
>> On Wed, 4 Jan 2006 15:51:38 +0100, Adrian Bunk <[email protected]> wrote:
>>...
>> > If you say Y here the kernel will use a 4Kb stacksize for the
>> > kernel stack attached to each process/thread. This facilitates
>>
>> Perhaps mention 4k + 4k stacks, the separate irq stacks used with 4k option?
>
>Feel free to submit a patch. ;-)

Okay :)


Based on Adrian Bunk's patch, default to 4k +4k stacks and making
it more obvious that available stack space is not being halved.
Compile tested.

Signed-off-by: Grant Coady <[email protected]>

---
Kconfig.debug | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.15a/arch/i386/Kconfig.debug 2005-10-28 10:02:08.000000000 +1000
+++ linux-2.6.15b/arch/i386/Kconfig.debug 2006-01-05 09:39:22.000000000 +1100
@@ -53,14 +53,15 @@
of memory corruptions.

config 4KSTACKS
- bool "Use 4Kb for kernel stacks instead of 8Kb"
- depends on DEBUG_KERNEL
+ bool "Use 4Kb + 4Kb for kernel stacks instead of 8Kb" if DEBUG_KERNEL
+ default y
help
If you say Y here the kernel will use a 4Kb stacksize for the
kernel stack attached to each process/thread. This facilitates
running more threads on a system and also reduces the pressure
on the VM subsystem for higher order allocations. This option
- will also use IRQ stacks to compensate for the reduced stackspace.
+ will also use separate 4Kb IRQ stacks to compensate for the
+ reduced stackspace.

config X86_FIND_SMP_CONFIG
bool