public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] UML - Fix kernel stack size on x86_64
@ 2007-06-05 20:50 Jeff Dike
  2007-06-06  0:00 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2007-06-05 20:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, uml-devel

[ This is 2.6.22 material ]

Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
Kconfig, breaking UML/x86_64, which wants 2 page stacks.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
--
 arch/um/defconfig |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6.21-mm/arch/um/defconfig
===================================================================
--- linux-2.6.21-mm.orig/arch/um/defconfig	2007-06-05 12:18:35.000000000 -0400
+++ linux-2.6.21-mm/arch/um/defconfig	2007-06-05 12:19:12.000000000 -0400
@@ -86,7 +86,6 @@ CONFIG_MCONSOLE=y
 # CONFIG_MAGIC_SYSRQ is not set
 CONFIG_NEST_LEVEL=0
 # CONFIG_HIGHMEM is not set
-CONFIG_KERNEL_STACK_ORDER=0
 CONFIG_UML_REAL_TIME_CLOCK=y
 
 #

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

* Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64
  2007-06-05 20:50 [PATCH 2/2] UML - Fix kernel stack size on x86_64 Jeff Dike
@ 2007-06-06  0:00 ` Andrew Morton
  2007-06-06  0:37   ` Jeff Dike
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-06-06  0:00 UTC (permalink / raw)
  To: Jeff Dike; +Cc: LKML, uml-devel

On Tue, 5 Jun 2007 16:50:55 -0400
Jeff Dike <jdike@addtoit.com> wrote:

> [ This is 2.6.22 material ]
> 
> Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
> Kconfig, breaking UML/x86_64, which wants 2 page stacks.
> 
> Signed-off-by: Jeff Dike <jdike@linux.intel.com>
> --
>  arch/um/defconfig |    1 -
>  1 file changed, 1 deletion(-)
> 
> Index: linux-2.6.21-mm/arch/um/defconfig
> ===================================================================
> --- linux-2.6.21-mm.orig/arch/um/defconfig	2007-06-05 12:18:35.000000000 -0400
> +++ linux-2.6.21-mm/arch/um/defconfig	2007-06-05 12:19:12.000000000 -0400
> @@ -86,7 +86,6 @@ CONFIG_MCONSOLE=y
>  # CONFIG_MAGIC_SYSRQ is not set
>  CONFIG_NEST_LEVEL=0
>  # CONFIG_HIGHMEM is not set
> -CONFIG_KERNEL_STACK_ORDER=0
>  CONFIG_UML_REAL_TIME_CLOCK=y
>  

That means the Kconfig rules are wrong, surely?

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

* Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64
  2007-06-06  0:00 ` Andrew Morton
@ 2007-06-06  0:37   ` Jeff Dike
  2007-06-06  1:20     ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2007-06-06  0:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, uml-devel

On Tue, Jun 05, 2007 at 05:00:01PM -0700, Andrew Morton wrote:
> On Tue, 5 Jun 2007 16:50:55 -0400
> Jeff Dike <jdike@addtoit.com> wrote:
> 
> > [ This is 2.6.22 material ]
> > 
> > Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
> > Kconfig, breaking UML/x86_64, which wants 2 page stacks.

> That means the Kconfig rules are wrong, surely?

I'm far from a Kconfig expert, but what I have is

config KERNEL_STACK_ORDER
	int "Kernel stack size order"
	default 1 if 64BIT
	default 0 if !64BIT

which seems reasonably clear and simple...

				Jeff

-- 
Work email - jdike at linux dot intel dot com

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

* Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64
  2007-06-06  0:37   ` Jeff Dike
@ 2007-06-06  1:20     ` Andrew Morton
  2007-06-06 15:11       ` Jeff Dike
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-06-06  1:20 UTC (permalink / raw)
  To: Jeff Dike; +Cc: LKML, uml-devel

On Tue, 5 Jun 2007 20:37:52 -0400 Jeff Dike <jdike@addtoit.com> wrote:

> On Tue, Jun 05, 2007 at 05:00:01PM -0700, Andrew Morton wrote:
> > On Tue, 5 Jun 2007 16:50:55 -0400
> > Jeff Dike <jdike@addtoit.com> wrote:
> > 
> > > [ This is 2.6.22 material ]
> > > 
> > > Having KERNEL_STACK_ORDER in defconfig overrides the value provided by
> > > Kconfig, breaking UML/x86_64, which wants 2 page stacks.
> 
> > That means the Kconfig rules are wrong, surely?
> 
> I'm far from a Kconfig expert,

Me either.  I learn enough for the problem at hand, then instaforget it
again.  Kinda like perl.

> but what I have is
> 
> config KERNEL_STACK_ORDER
> 	int "Kernel stack size order"
> 	default 1 if 64BIT
> 	default 0 if !64BIT
> 
> which seems reasonably clear and simple...
> 

hm, OK, there's the problem.  This is an offered-to-the-user config option.

If you do

-	int "Kernel stack size order"
+	int

then this rule will no longer be offered to the user and `make oldconfig'
(actually anythingconfig) will override whatever happens to be in .config
for KERNEL_STACK_ORDER.

I'm not sure if that's actually what you want, but if the current situation
is that a random CONFIG_KERNEL_STACK_ORDER=0 left over in .config will
break the kernel at runtime then I think something sterner than editing
defconfig is needed?


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

* Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64
  2007-06-06  1:20     ` Andrew Morton
@ 2007-06-06 15:11       ` Jeff Dike
  2007-06-06 18:03         ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2007-06-06 15:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, uml-devel

On Tue, Jun 05, 2007 at 06:20:24PM -0700, Andrew Morton wrote:
> If you do
> 
> -	int "Kernel stack size order"
> +	int
> 
> then this rule will no longer be offered to the user and `make oldconfig'
> (actually anythingconfig) will override whatever happens to be in .config
> for KERNEL_STACK_ORDER.

You're saying that making an option user-visible changes whether
*config overrides .config?  That's non-intuitive.

> I'm not sure if that's actually what you want, but if the current situation
> is that a random CONFIG_KERNEL_STACK_ORDER=0 left over in .config will
> break the kernel at runtime then I think something sterner than editing
> defconfig is needed?

That's a good point, but I think I do want it user-visible.  If
someone sees someething I suspect to be a stack overflow, I'd like to
be able to tell them to bump KERNEL_STACK_ORDER and see if the problem
goes away.

As for something sterner, it turns out that Kbuild provides some
support for this.  So, drop the previous patch in favor of this one:

Force KERNEL_STACK_ORDER to be at least 1 on UML/x86_64.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
--
 arch/um/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.21-mm/arch/um/Kconfig
===================================================================
--- linux-2.6.21-mm.orig/arch/um/Kconfig	2007-06-06 09:28:13.000000000 -0400
+++ linux-2.6.21-mm/arch/um/Kconfig	2007-06-06 11:08:49.000000000 -0400
@@ -278,6 +278,7 @@ config HIGHMEM
 config KERNEL_STACK_ORDER
 	int "Kernel stack size order"
 	default 1 if 64BIT
+	range 1 10 if 64BIT
 	default 0 if !64BIT
 	help
 	This option determines the size of UML kernel stacks.  They will

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

* Re: [PATCH 2/2] UML - Fix kernel stack size on x86_64
  2007-06-06 15:11       ` Jeff Dike
@ 2007-06-06 18:03         ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2007-06-06 18:03 UTC (permalink / raw)
  To: Jeff Dike; +Cc: LKML, uml-devel

On Wed, 6 Jun 2007 11:11:34 -0400 Jeff Dike <jdike@addtoit.com> wrote:

> On Tue, Jun 05, 2007 at 06:20:24PM -0700, Andrew Morton wrote:
> > If you do
> > 
> > -	int "Kernel stack size order"
> > +	int
> > 
> > then this rule will no longer be offered to the user and `make oldconfig'
> > (actually anythingconfig) will override whatever happens to be in .config
> > for KERNEL_STACK_ORDER.
> 
> You're saying that making an option user-visible changes whether
> *config overrides .config?  That's non-intuitive.

Yeah, I thought so.  I discovered it by comparing the behaviour of your
patch against the behaviour of CONFIG_BASE_SMALL, fiddling around and
then saying "wtf".

> > I'm not sure if that's actually what you want, but if the current situation
> > is that a random CONFIG_KERNEL_STACK_ORDER=0 left over in .config will
> > break the kernel at runtime then I think something sterner than editing
> > defconfig is needed?
> 
> That's a good point, but I think I do want it user-visible.  If
> someone sees someething I suspect to be a stack overflow, I'd like to
> be able to tell them to bump KERNEL_STACK_ORDER and see if the problem
> goes away.
> 
> As for something sterner, it turns out that Kbuild provides some
> support for this.  So, drop the previous patch in favor of this one:
> 
> Force KERNEL_STACK_ORDER to be at least 1 on UML/x86_64.
> 
> Signed-off-by: Jeff Dike <jdike@linux.intel.com>
> --
>  arch/um/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux-2.6.21-mm/arch/um/Kconfig
> ===================================================================
> --- linux-2.6.21-mm.orig/arch/um/Kconfig	2007-06-06 09:28:13.000000000 -0400
> +++ linux-2.6.21-mm/arch/um/Kconfig	2007-06-06 11:08:49.000000000 -0400
> @@ -278,6 +278,7 @@ config HIGHMEM
>  config KERNEL_STACK_ORDER
>  	int "Kernel stack size order"
>  	default 1 if 64BIT
> +	range 1 10 if 64BIT
>  	default 0 if !64BIT
>  	help
>  	This option determines the size of UML kernel stacks.  They will

heh, fair enough.

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

end of thread, other threads:[~2007-06-06 18:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05 20:50 [PATCH 2/2] UML - Fix kernel stack size on x86_64 Jeff Dike
2007-06-06  0:00 ` Andrew Morton
2007-06-06  0:37   ` Jeff Dike
2007-06-06  1:20     ` Andrew Morton
2007-06-06 15:11       ` Jeff Dike
2007-06-06 18:03         ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox