Re: 2G memory split

From: Linus Torvalds
Date: Tue Jan 10 2006 - 11:13:33 EST




On Tue, 10 Jan 2006, Jens Axboe wrote:
>
> A newer version, trying to cater to the various comments in here.
> Changes:

Can we do one final cleanup? Do all the magic in _one_ place, namely the
x86 Kconfig file.

Also, I don't think the NOHIGHMEM dependency is necessarily correct. A
2G/2G split can be advantageous with a 16GB setup (you'll have more room
for dentries etc), but you obviously want to have HIGHMEM for that..

Do it something like this:

choice
depends on EXPERIMENTAL
prompt "Memory split"
default DEFAULT_3G
help
Select the wanted split between kernel and user memory.
If the address range available to the kernel is less than the
physical memory installed, the remaining memory will be available
as "high memory". Accessing high memory is a little more costly
than low memory, as it needs to be mapped into the kernel first.
Note that selecting anything but the default 3G/1G split will make
your kernel incompatible with binary only modules.

config DEFAULT_3G
bool "3G/1G user/kernel split"
config DEFAULT_3G_OPT
bool "3G/1G user/kernel split (for full 1G low memory)"
config DEFAULT_2G
bool "2G/2G user/kernel split"
config DEFAULT_1G
bool "1G/3G user/kernel split"
endchoice

config PAGE_OFFSET
hex
default 0xC0000000
default 0xB0000000 if DEFAULT_3G_OPT
default 0x78000000 if DEFAULT_2G
default 0x40000000 if DEFAULT_1G

and then asm-i386/page.h can just do

#define __PAGE_OFFSET ((unsigned long)CONFIG_PAGE_OFFSET)

and you're done.

If you ever want to change the offsets, you're only changing the Kconfig
file, and as you can tell, the syntax is actually much _nicer_ that using
the C preprocessor, since these kinds of choices is exactly what the
Kconfig language is all about.

Please?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/