diff options
author | Mark Lord <lkml@rtr.ca> | 2006-02-01 06:06:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:21 -0500 |
commit | 975b3d3d5b983eb60706d35f0d24cd19f6badabf (patch) | |
tree | 39d55db9236ef1acef4e955617296217c3a9fc02 | |
parent | 4940fb441275d654cff7d0f7708f91bd8435a85a (diff) |
[PATCH] VMSPLIT config options
Enable selection of different user/kernel VM splits for i386, including an
optimized mode for 1GB physical RAM, which gives the kernel a direct (non
HIGHMEM) mapping to the entire 1GB rather than just the first 896MB.
There is a similarly a similarly optimized mode for machines with exactly 2GB
of physical RAM.
This can speed up the kernel by avoiding having to create/destroy temporary
HIGHMEM mappings, and by not having to include HIGHMEM support at all on such
machines. The flip side is that there's less virtual addressing left for
userspace in these alternatives, and some binary-only kernel modules may
misbehave unless rebuilt with the same VMSPLIT option as the main kernel
image.
Original idea/patch from Jens Axboe, modified based on suggestions from Linus
et al.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/Kconfig | 37 | ||||
-rw-r--r-- | include/asm-i386/page.h | 4 |
2 files changed, 39 insertions, 2 deletions
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 4e9e49a55ea8..d86c865a7cd2 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -448,6 +448,43 @@ config HIGHMEM64G | |||
448 | 448 | ||
449 | endchoice | 449 | endchoice |
450 | 450 | ||
451 | choice | ||
452 | depends on EXPERIMENTAL && !X86_PAE | ||
453 | prompt "Memory split" | ||
454 | default VMSPLIT_3G | ||
455 | help | ||
456 | Select the desired split between kernel and user memory. | ||
457 | |||
458 | If the address range available to the kernel is less than the | ||
459 | physical memory installed, the remaining memory will be available | ||
460 | as "high memory". Accessing high memory is a little more costly | ||
461 | than low memory, as it needs to be mapped into the kernel first. | ||
462 | Note that increasing the kernel address space limits the range | ||
463 | available to user programs, making the address space there | ||
464 | tighter. Selecting anything other than the default 3G/1G split | ||
465 | will also likely make your kernel incompatible with binary-only | ||
466 | kernel modules. | ||
467 | |||
468 | If you are not absolutely sure what you are doing, leave this | ||
469 | option alone! | ||
470 | |||
471 | config VMSPLIT_3G | ||
472 | bool "3G/1G user/kernel split" | ||
473 | config VMSPLIT_3G_OPT | ||
474 | bool "3G/1G user/kernel split (for full 1G low memory)" | ||
475 | config VMSPLIT_2G | ||
476 | bool "2G/2G user/kernel split" | ||
477 | config VMSPLIT_1G | ||
478 | bool "1G/3G user/kernel split" | ||
479 | endchoice | ||
480 | |||
481 | config PAGE_OFFSET | ||
482 | hex | ||
483 | default 0xB0000000 if VMSPLIT_3G_OPT | ||
484 | default 0x78000000 if VMSPLIT_2G | ||
485 | default 0x40000000 if VMSPLIT_1G | ||
486 | default 0xC0000000 | ||
487 | |||
451 | config HIGHMEM | 488 | config HIGHMEM |
452 | bool | 489 | bool |
453 | depends on HIGHMEM64G || HIGHMEM4G | 490 | depends on HIGHMEM64G || HIGHMEM4G |
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 73296d9924fb..997ca5d17876 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
@@ -110,10 +110,10 @@ extern int page_is_ram(unsigned long pagenr); | |||
110 | #endif /* __ASSEMBLY__ */ | 110 | #endif /* __ASSEMBLY__ */ |
111 | 111 | ||
112 | #ifdef __ASSEMBLY__ | 112 | #ifdef __ASSEMBLY__ |
113 | #define __PAGE_OFFSET (0xC0000000) | 113 | #define __PAGE_OFFSET CONFIG_PAGE_OFFSET |
114 | #define __PHYSICAL_START CONFIG_PHYSICAL_START | 114 | #define __PHYSICAL_START CONFIG_PHYSICAL_START |
115 | #else | 115 | #else |
116 | #define __PAGE_OFFSET (0xC0000000UL) | 116 | #define __PAGE_OFFSET ((unsigned long)CONFIG_PAGE_OFFSET) |
117 | #define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START) | 117 | #define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START) |
118 | #endif | 118 | #endif |
119 | #define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) | 119 | #define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) |