Skip to contentSkip to conversation

UML - Fix kernel stack size on x86_64

PATCH In review Jeff Dike 2 participants 6 messages Jun 5, 2007 – Jun 6, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 2/2 UML - Fix kernel stack size on x86_64

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

--

 arch/um/defconfig |    1 -
 1 file changed, 1 deletion(-)
arch/um/defconfig +0 -1
Index: linux-2.6.21-mm/arch/um/defconfig
===================================================================
@@ -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
 
 #

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 15 lines · On Tue, 5 Jun 2007 16:50:55 -0400 Jeff Dike <[email protected]> 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.

--

 arch/um/defconfig |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6.21-mm/arch/um/defconfig
===================================================================

arch/um/defconfig CONFIG_MCONSOLE=y · line 90

Quoted 6 lines
arch/um/defconfig +0 -1
@@ -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?

author
#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Tue, 5 Jun 2007 16:50:55 -0400 Jeff Dike <[email protected]> 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

Signature · 11 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#3 lore raw
Quoted 4 lines · On Tue, 5 Jun 2007 20:37:52 -0400 Jeff Dike <[email protected]> wrote:
Quoted 3 lines · Andrew Morton

On Tue, 5 Jun 2007 16:50:55 -0400
Jeff Dike <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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

Quoted 9 lines

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?

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#4 lore raw
Quoted 8 lines · Andrew Morton

If you do

(quoted diff) +1 -1
-	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.

Quoted 4 lines

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.

--

 arch/um/Kconfig |    1 +
 1 file changed, 1 insertion(+)
arch/um/Kconfig +1 -0
Index: linux-2.6.21-mm/arch/um/Kconfig
===================================================================
@@ -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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw
Quoted 6 lines · On Wed, 6 Jun 2007 11:11:34 -0400 Jeff Dike <[email protected]> wrote:
Quoted 5 lines · Andrew Morton

If you do

(quoted diff) +1 -1
-	int "Kernel stack size order"
+	int
Quoted 6 lines
Quoted 3 lines

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

Quoted 25 lines
Quoted 4 lines

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.

--

 arch/um/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.21-mm/arch/um/Kconfig
===================================================================

arch/um/Kconfig config HIGHMEM · line 284

Quoted 7 lines
arch/um/Kconfig +1 -0
@@ -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.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel