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

Commit c87ff943 authored by Tony Luck's avatar Tony Luck
Browse files

Pull sparsemem-v5 into release branch

parents 556902cd 1e5c936e
Loading
Loading
Loading
Loading
+56 −38
Original line number Diff line number Diff line
@@ -63,8 +63,6 @@ config IA64_GENERIC
	select ACPI
	select NUMA
	select ACPI_NUMA
	select VIRTUAL_MEM_MAP
	select DISCONTIGMEM
	help
	  This selects the system type of your hardware.  A "generic" kernel
	  will run on any supported IA-64 system.  However, if you configure
@@ -176,40 +174,6 @@ config IA64_L1_CACHE_SHIFT
	default "6" if ITANIUM

# align cache-sensitive data to 64 bytes
config NUMA
	bool "NUMA support"
	depends on !IA64_HP_SIM
	default y if IA64_SGI_SN2
	select ACPI_NUMA
	help
	  Say Y to compile the kernel to support NUMA (Non-Uniform Memory
	  Access).  This option is for configuring high-end multiprocessor
	  server systems.  If in doubt, say N.

config VIRTUAL_MEM_MAP
	bool "Virtual mem map"
	default y if !IA64_HP_SIM
	help
	  Say Y to compile the kernel with support for a virtual mem map.
	  This code also only takes effect if a memory hole of greater than
	  1 Gb is found during boot.  You must turn this option on if you
	  require the DISCONTIGMEM option for your machine. If you are
	  unsure, say Y.

config HOLES_IN_ZONE
	bool
	default y if VIRTUAL_MEM_MAP

config ARCH_DISCONTIGMEM_ENABLE
	bool "Discontiguous memory support"
	depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB) && NUMA && VIRTUAL_MEM_MAP
	default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
	help
	  Say Y to support efficient handling of discontiguous physical memory,
	  for architectures which are either NUMA (Non-Uniform Memory Access)
	  or have huge holes in the physical address space for other reasons.
	  See <file:Documentation/vm/numa> for more.

config IA64_CYCLONE
	bool "Cyclone (EXA) Time Source support"
	help
@@ -232,8 +196,10 @@ config IA64_SGI_SN_XP
	  based on a network adapter and DMA messaging.

config FORCE_MAX_ZONEORDER
	int
	default "18"
	int "MAX_ORDER (11 - 17)"  if !HUGETLB_PAGE
	range 11 17  if !HUGETLB_PAGE
	default "17" if HUGETLB_PAGE
	default "11"

config SMP
	bool "Symmetric multi-processing support"
@@ -298,6 +264,58 @@ config PREEMPT

source "mm/Kconfig"

config ARCH_SELECT_MEMORY_MODEL
	def_bool y

config ARCH_DISCONTIGMEM_ENABLE
	def_bool y
	help
	  Say Y to support efficient handling of discontiguous physical memory,
	  for architectures which are either NUMA (Non-Uniform Memory Access)
	  or have huge holes in the physical address space for other reasons.
 	  See <file:Documentation/vm/numa> for more.

config ARCH_FLATMEM_ENABLE
	def_bool y

config ARCH_SPARSEMEM_ENABLE
	def_bool y
	depends on ARCH_DISCONTIGMEM_ENABLE

config ARCH_DISCONTIGMEM_DEFAULT
	def_bool y if (IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB)
	depends on ARCH_DISCONTIGMEM_ENABLE

config NUMA
	bool "NUMA support"
	depends on !IA64_HP_SIM && !FLATMEM
	default y if IA64_SGI_SN2
	help
	  Say Y to compile the kernel to support NUMA (Non-Uniform Memory
	  Access).  This option is for configuring high-end multiprocessor
	  server systems.  If in doubt, say N.

# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
# VIRTUAL_MEM_MAP has been retained for historical reasons.
config VIRTUAL_MEM_MAP
	bool "Virtual mem map"
	depends on !SPARSEMEM
	default y if !IA64_HP_SIM
	help
	  Say Y to compile the kernel with support for a virtual mem map.
	  This code also only takes effect if a memory hole of greater than
	  1 Gb is found during boot.  You must turn this option on if you
	  require the DISCONTIGMEM option for your machine. If you are
	  unsure, say Y.

config HOLES_IN_ZONE
	bool
	default y if VIRTUAL_MEM_MAP

config HAVE_ARCH_EARLY_PFN_TO_NID
	def_bool y
	depends on NEED_MULTIPLE_NODES

config IA32_SUPPORT
	bool "Support for Linux/x86 binaries"
	help
+1319 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −3
Original line number Diff line number Diff line
@@ -7,6 +7,5 @@ obj-y := init.o fault.o tlb.o extable.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_NUMA)	   += numa.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o
ifndef CONFIG_DISCONTIGMEM
obj-y += contig.o
endif
obj-$(CONFIG_SPARSEMEM)	   += discontig.o
obj-$(CONFIG_FLATMEM)	   += contig.o
+2 −2
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ paging_init (void)
	efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
	if (max_gap < LARGE_GAP) {
		vmem_map = (struct page *) 0;
		free_area_init_node(0, &contig_page_data, zones_size, 0,
		free_area_init_node(0, NODE_DATA(0), zones_size, 0,
				    zholes_size);
	} else {
		unsigned long map_size;
@@ -282,7 +282,7 @@ paging_init (void)
		efi_memmap_walk(create_mem_map_page_table, NULL);

		NODE_DATA(0)->node_mem_map = vmem_map;
		free_area_init_node(0, &contig_page_data, zones_size,
		free_area_init_node(0, NODE_DATA(0), zones_size,
				    0, zholes_size);

		printk("Virtual mem_map starts at 0x%p\n", mem_map);
+41 −2
Original line number Diff line number Diff line
@@ -421,6 +421,37 @@ static void __init memory_less_nodes(void)
	return;
}

#ifdef CONFIG_SPARSEMEM
/**
 * register_sparse_mem - notify SPARSEMEM that this memory range exists.
 * @start: physical start of range
 * @end: physical end of range
 * @arg: unused
 *
 * Simply calls SPARSEMEM to register memory section(s).
 */
static int __init register_sparse_mem(unsigned long start, unsigned long end,
	void *arg)
{
	int nid;

	start = __pa(start) >> PAGE_SHIFT;
	end = __pa(end) >> PAGE_SHIFT;
	nid = early_pfn_to_nid(start);
	memory_present(nid, start, end);

	return 0;
}

static void __init arch_sparse_init(void)
{
	efi_memmap_walk(register_sparse_mem, NULL);
	sparse_init();
}
#else
#define arch_sparse_init() do {} while (0)
#endif

/**
 * find_memory - walk the EFI memory map and setup the bootmem allocator
 *
@@ -528,8 +559,10 @@ void show_mem(void)
		int shared = 0, cached = 0, reserved = 0;
		printk("Node ID: %d\n", pgdat->node_id);
		for(i = 0; i < pgdat->node_spanned_pages; i++) {
			struct page *page = pgdat_page_nr(pgdat, i);
			if (!ia64_pfn_valid(pgdat->node_start_pfn+i))
			struct page *page;
			if (pfn_valid(pgdat->node_start_pfn + i))
				page = pfn_to_page(pgdat->node_start_pfn + i);
			else
				continue;
			if (PageReserved(page))
				reserved++;
@@ -648,12 +681,16 @@ void __init paging_init(void)

	max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;

	arch_sparse_init();

	efi_memmap_walk(filter_rsvd_memory, count_node_pages);

#ifdef CONFIG_VIRTUAL_MEM_MAP
	vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page));
	vmem_map = (struct page *) vmalloc_end;
	efi_memmap_walk(create_mem_map_page_table, NULL);
	printk("Virtual mem_map starts at 0x%p\n", vmem_map);
#endif

	for_each_online_node(node) {
		memset(zones_size, 0, sizeof(zones_size));
@@ -690,7 +727,9 @@ void __init paging_init(void)

		pfn_offset = mem_data[node].min_pfn;

#ifdef CONFIG_VIRTUAL_MEM_MAP
		NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset;
#endif
		free_area_init_node(node, NODE_DATA(node), zones_size,
				    pfn_offset, zholes_size);
	}
Loading