linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] mm: Introduce kernelcore=mirror option
@ 2016-01-08  8:25 Taku Izumi
  2016-01-08  8:26 ` Taku Izumi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Taku Izumi @ 2016-01-08  8:25 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: tony.luck, qiuxishi, kamezawa.hiroyu, mel, dave.hansen, matt,
	arnd, steve.capper, sudeep.holla, Taku Izumi

Xeon E7 v3 based systems supports Address Range Mirroring
and UEFI BIOS complied with UEFI spec 2.5 can notify which
ranges are mirrored (reliable) via EFI memory map.
Now Linux kernel utilize its information and allocates 
boot time memory from reliable region.

My requirement is:
  - allocate kernel memory from mirrored region 
  - allocate user memory from non-mirrored region

In order to meet my requirement, ZONE_MOVABLE is useful.
By arranging non-mirrored range into ZONE_MOVABLE, 
mirrored memory is used for kernel allocations.

My idea is to extend existing "kernelcore" option and 
introduces kernelcore=mirror option. By specifying
"mirror" instead of specifying the amount of memory,
non-mirrored region will be arranged into ZONE_MOVABLE.

Earlier discussions are at: 
 https://lkml.org/lkml/2015/10/9/24
 https://lkml.org/lkml/2015/10/15/9
 https://lkml.org/lkml/2015/11/27/18
 https://lkml.org/lkml/2015/12/8/836

For example, suppose 2-nodes system with the following memory
 range: 
  node 0 [mem 0x0000000000001000-0x000000109fffffff] 
  node 1 [mem 0x00000010a0000000-0x000000209fffffff]
and the following ranges are marked as reliable (mirrored):
  [0x0000000000000000-0x0000000100000000] 
  [0x0000000100000000-0x0000000180000000] 
  [0x0000000800000000-0x0000000880000000] 
  [0x00000010a0000000-0x0000001120000000]
  [0x00000017a0000000-0x0000001820000000] 

If you specify kernelcore=mirror, ZONE_NORMAL and ZONE_MOVABLE
are arranged like bellow:

 - node 0:
  ZONE_NORMAL : [0x0000000100000000-0x00000010a0000000]
  ZONE_MOVABLE: [0x0000000180000000-0x00000010a0000000]
 - node 1: 
  ZONE_NORMAL : [0x00000010a0000000-0x00000020a0000000]
  ZONE_MOVABLE: [0x0000001120000000-0x00000020a0000000]
 
In overlapped range, pages to be ZONE_MOVABLE in ZONE_NORMAL
are treated as absent pages, and vice versa.

This patchset is created against "akpm" branch of linux-next


v1 -> v2:
 - Refine so that the above example case also can be
 handled properly:
v2 -> v3:
 - Change the option name from kernelcore=reliable
 into kernelcore=mirror and some documentation fix
 according to Andrew Morton's point
v3 -> v4:
 - Fix up the case of CONFIG_HAVE_MEMBLOCK_NODE_MAP=n
   (Fix boot failed of ARM machines)
 - No functional change in case of CONFIG_HAVE_MEMBLOCK_NODE_MAP=y


Taku Izumi (2):
  mm/page_alloc.c: calculate zone_start_pfn at
    zone_spanned_pages_in_node()
  mm/page_alloc.c: introduce kernelcore=mirror option

 Documentation/kernel-parameters.txt |  12 ++-
 mm/page_alloc.c                     | 154 ++++++++++++++++++++++++++++++++----
 2 files changed, 148 insertions(+), 18 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-11  9:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08  8:25 [PATCH v4 0/2] mm: Introduce kernelcore=mirror option Taku Izumi
2016-01-08  8:26 ` Taku Izumi
2016-01-08  8:26 ` [PATCH v4 1/2] mm/page_alloc.c: calculate zone_start_pfn at zone_spanned_pages_in_node() Taku Izumi
2016-01-08  8:26 ` [PATCH v4 2/2] mm/page_alloc.c: introduce kernelcore=mirror option Taku Izumi
2016-01-08 17:02   ` Sudeep Holla
2016-01-08 23:12     ` Andrew Morton
2016-01-11  9:56       ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).