Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed7ed365 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

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: default avatarMel Gorman <mel@csn.ul.ie>
Signed-off-by: default avatarYasunori Goto <y-goto@jp.fujitsu.com>
Acked-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 396faf03
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1348,6 +1348,21 @@ nr_hugepages configures number of hugetlb page reserved for the system.
hugetlb_shm_group contains group id that is allowed to create SysV shared
memory segment using hugetlb page.

hugepages_treat_as_movable
--------------------------

This parameter is only useful when kernelcore= is specified at boot time to
create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages
are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero
value written to hugepages_treat_as_movable allows huge pages to be allocated
from ZONE_MOVABLE.

Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge
pages pool can easily grow or shrink within. Assuming that applications are
not running that mlock() a lot of memory, it is likely the huge pages pool
can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value
into nr_hugepages and triggering page reclaim.

laptop_mode
-----------

+16 −0
Original line number Diff line number Diff line
@@ -817,6 +817,22 @@ and is between 256 and 4096 characters. It is defined in the file
	js=		[HW,JOY] Analog joystick
			See Documentation/input/joystick.txt.

	kernelcore=nn[KMG]	[KNL,IA-32,IA-64,PPC,X86-64] This parameter
			specifies the amount of memory usable by the kernel
			for non-movable allocations.  The requested amount is
			spread evenly throughout all nodes in the system. The
			remaining memory in each node is used for Movable
			pages. In the event, a node is too small to have both
			kernelcore and Movable pages, kernelcore pages will
			take priority and other nodes will have a larger number
			of kernelcore pages.  The Movable zone is used for the
			allocation of pages that may be reclaimed or moved
			by the page migration subsystem.  This means that
			HugeTLB pages may not be allocated from this zone.
			Note that allocations like PTEs-from-HighMem still
			use the HighMem zone if it exists, and the Normal
			zone if it does not.

	keepinitrd	[HW,ARM]

	kstack=N	[IA-32,X86-64] Print N words from the kernel stack
+2 −1
Original line number Diff line number Diff line
@@ -38,7 +38,8 @@ Currently, these files are in /proc/sys/vm:

dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
block_dump, swap_token_timeout, drop-caches:
block_dump, swap_token_timeout, drop-caches,
hugepages_treat_as_movable:

See Documentation/filesystems/proc.txt

+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <linux/time.h>
#include <linux/efi.h>
#include <linux/kexec.h>
#include <linux/mm.h>

#include <asm/io.h>
#include <asm/kregs.h>
+0 −1
Original line number Diff line number Diff line
@@ -1005,7 +1005,6 @@ extern unsigned long find_max_pfn_with_active_regions(void);
extern void free_bootmem_with_active_regions(int nid,
						unsigned long max_low_pfn);
extern void sparse_memory_present_with_active_regions(int nid);
extern int cmdline_parse_kernelcore(char *p);
#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
extern int early_pfn_to_nid(unsigned long pfn);
#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
Loading