diff options
| author | Mel Gorman <mel@csn.ul.ie> | 2007-07-17 07:03:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:22:59 -0400 |
| commit | ed7ed365172e27b0efe9d43cc962723c7193e34e (patch) | |
| tree | 6c22daf6908f92c64aae2b425e6383fe0ed404ac | |
| parent | 396faf0303d273219db5d7eb4a2879ad977ed185 (diff) | |
handle kernelcore=: generic
This patch adds the kernelcore= parameter for x86.
Once all patches are applied, a new command-line parameter exist and a new
sysctl. This patch adds the necessary documentation.
From: Yasunori Goto <y-goto@jp.fujitsu.com>
When "kernelcore" boot option is specified, kernel can't boot up on ia64
because of an infinite loop. In addition, the parsing code can be handled
in an architecture-independent manner.
This patch uses common code to handle the kernelcore= parameter. It is
only available to architectures that support arch-independent zone-sizing
(i.e. define CONFIG_ARCH_POPULATES_NODE_MAP). Other architectures will
ignore the boot parameter.
[bunk@stusta.de: make cmdline_parse_kernelcore() static]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | Documentation/filesystems/proc.txt | 15 | ||||
| -rw-r--r-- | Documentation/kernel-parameters.txt | 16 | ||||
| -rw-r--r-- | Documentation/sysctl/vm.txt | 3 | ||||
| -rw-r--r-- | arch/ia64/kernel/efi.c | 1 | ||||
| -rw-r--r-- | include/linux/mm.h | 1 | ||||
| -rw-r--r-- | mm/page_alloc.c | 5 |
6 files changed, 38 insertions, 3 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 460b892d089e..ebffdffb3d99 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
| @@ -1348,6 +1348,21 @@ nr_hugepages configures number of hugetlb page reserved for the system. | |||
| 1348 | hugetlb_shm_group contains group id that is allowed to create SysV shared | 1348 | hugetlb_shm_group contains group id that is allowed to create SysV shared |
| 1349 | memory segment using hugetlb page. | 1349 | memory segment using hugetlb page. |
| 1350 | 1350 | ||
| 1351 | hugepages_treat_as_movable | ||
| 1352 | -------------------------- | ||
| 1353 | |||
| 1354 | This parameter is only useful when kernelcore= is specified at boot time to | ||
| 1355 | create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages | ||
| 1356 | are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero | ||
| 1357 | value written to hugepages_treat_as_movable allows huge pages to be allocated | ||
| 1358 | from ZONE_MOVABLE. | ||
| 1359 | |||
| 1360 | Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge | ||
| 1361 | pages pool can easily grow or shrink within. Assuming that applications are | ||
| 1362 | not running that mlock() a lot of memory, it is likely the huge pages pool | ||
| 1363 | can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value | ||
| 1364 | into nr_hugepages and triggering page reclaim. | ||
| 1365 | |||
| 1351 | laptop_mode | 1366 | laptop_mode |
| 1352 | ----------- | 1367 | ----------- |
| 1353 | 1368 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 8363ad3ba018..1794affbd06f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -817,6 +817,22 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 817 | js= [HW,JOY] Analog joystick | 817 | js= [HW,JOY] Analog joystick |
| 818 | See Documentation/input/joystick.txt. | 818 | See Documentation/input/joystick.txt. |
| 819 | 819 | ||
| 820 | kernelcore=nn[KMG] [KNL,IA-32,IA-64,PPC,X86-64] This parameter | ||
| 821 | specifies the amount of memory usable by the kernel | ||
| 822 | for non-movable allocations. The requested amount is | ||
| 823 | spread evenly throughout all nodes in the system. The | ||
| 824 | remaining memory in each node is used for Movable | ||
| 825 | pages. In the event, a node is too small to have both | ||
| 826 | kernelcore and Movable pages, kernelcore pages will | ||
| 827 | take priority and other nodes will have a larger number | ||
| 828 | of kernelcore pages. The Movable zone is used for the | ||
| 829 | allocation of pages that may be reclaimed or moved | ||
| 830 | by the page migration subsystem. This means that | ||
| 831 | HugeTLB pages may not be allocated from this zone. | ||
| 832 | Note that allocations like PTEs-from-HighMem still | ||
| 833 | use the HighMem zone if it exists, and the Normal | ||
| 834 | zone if it does not. | ||
| 835 | |||
| 820 | keepinitrd [HW,ARM] | 836 | keepinitrd [HW,ARM] |
| 821 | 837 | ||
| 822 | kstack=N [IA-32,X86-64] Print N words from the kernel stack | 838 | kstack=N [IA-32,X86-64] Print N words from the kernel stack |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index df3ff2095f9d..a0ccc5b60260 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
| @@ -38,7 +38,8 @@ Currently, these files are in /proc/sys/vm: | |||
| 38 | 38 | ||
| 39 | dirty_ratio, dirty_background_ratio, dirty_expire_centisecs, | 39 | dirty_ratio, dirty_background_ratio, dirty_expire_centisecs, |
| 40 | dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode, | 40 | dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode, |
| 41 | block_dump, swap_token_timeout, drop-caches: | 41 | block_dump, swap_token_timeout, drop-caches, |
| 42 | hugepages_treat_as_movable: | ||
| 42 | 43 | ||
| 43 | See Documentation/filesystems/proc.txt | 44 | See Documentation/filesystems/proc.txt |
| 44 | 45 | ||
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 75ec3478d8a2..73ca86d03810 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/time.h> | 28 | #include <linux/time.h> |
| 29 | #include <linux/efi.h> | 29 | #include <linux/efi.h> |
| 30 | #include <linux/kexec.h> | 30 | #include <linux/kexec.h> |
| 31 | #include <linux/mm.h> | ||
| 31 | 32 | ||
| 32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
| 33 | #include <asm/kregs.h> | 34 | #include <asm/kregs.h> |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 857e44817178..97d0cddfd223 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1005,7 +1005,6 @@ extern unsigned long find_max_pfn_with_active_regions(void); | |||
| 1005 | extern void free_bootmem_with_active_regions(int nid, | 1005 | extern void free_bootmem_with_active_regions(int nid, |
| 1006 | unsigned long max_low_pfn); | 1006 | unsigned long max_low_pfn); |
| 1007 | extern void sparse_memory_present_with_active_regions(int nid); | 1007 | extern void sparse_memory_present_with_active_regions(int nid); |
| 1008 | extern int cmdline_parse_kernelcore(char *p); | ||
| 1009 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | 1008 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID |
| 1010 | extern int early_pfn_to_nid(unsigned long pfn); | 1009 | extern int early_pfn_to_nid(unsigned long pfn); |
| 1011 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | 1010 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c3f6f851f76e..0a53728a12f5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -3416,7 +3416,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn) | |||
| 3416 | * kernelcore=size sets the amount of memory for use for allocations that | 3416 | * kernelcore=size sets the amount of memory for use for allocations that |
| 3417 | * cannot be reclaimed or migrated. | 3417 | * cannot be reclaimed or migrated. |
| 3418 | */ | 3418 | */ |
| 3419 | int __init cmdline_parse_kernelcore(char *p) | 3419 | static int __init cmdline_parse_kernelcore(char *p) |
| 3420 | { | 3420 | { |
| 3421 | unsigned long long coremem; | 3421 | unsigned long long coremem; |
| 3422 | if (!p) | 3422 | if (!p) |
| @@ -3430,6 +3430,9 @@ int __init cmdline_parse_kernelcore(char *p) | |||
| 3430 | 3430 | ||
| 3431 | return 0; | 3431 | return 0; |
| 3432 | } | 3432 | } |
| 3433 | |||
| 3434 | early_param("kernelcore", cmdline_parse_kernelcore); | ||
| 3435 | |||
| 3433 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | 3436 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ |
| 3434 | 3437 | ||
| 3435 | /** | 3438 | /** |
