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

Commit e7e8de59 authored by Tang Chen's avatar Tang Chen Committed by Linus Torvalds
Browse files

memblock: make memblock_set_node() support different memblock_type



[sfr@canb.auug.org.au: fix powerpc build]
Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
Reviewed-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Rafael J . Wysocki" <rjw@sisk.pl>
Cc: Chen Tang <imtangchen@gmail.com>
Cc: Gong Chen <gong.chen@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Liu Jiang <jiang.liu@huawei.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Taku Izumi <izumi.taku@jp.fujitsu.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 66b16edf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -204,7 +204,8 @@ static void __init do_init_bootmem(void)
		start_pfn = memblock_region_memory_base_pfn(reg);
		end_pfn = memblock_region_memory_end_pfn(reg);
		memblock_set_node(PFN_PHYS(start_pfn),
				  PFN_PHYS(end_pfn - start_pfn), 0);
				  PFN_PHYS(end_pfn - start_pfn),
				  &memblock.memory, 0);
	}

	/* All of system RAM sits in node 0 for the non-NUMA case */
+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
	memblock_add(start, end - start);

	memblock_set_node(PFN_PHYS(start_pfn),
			  PFN_PHYS(end_pfn - start_pfn), nid);
			  PFN_PHYS(end_pfn - start_pfn),
			  &memblock.memory, nid);

	/* Node-local pgdat */
	pgdat_paddr = memblock_alloc_base(sizeof(struct pglist_data),
+2 −1
Original line number Diff line number Diff line
@@ -192,7 +192,8 @@ void __init setup_memory(void)
		start_pfn = memblock_region_memory_base_pfn(reg);
		end_pfn = memblock_region_memory_end_pfn(reg);
		memblock_set_node(start_pfn << PAGE_SHIFT,
					(end_pfn - start_pfn) << PAGE_SHIFT, 0);
				  (end_pfn - start_pfn) << PAGE_SHIFT,
				  &memblock.memory, 0);
	}

	/* free bootmem is whole main memory */
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ void __init do_init_bootmem(void)
	/* Place all memblock_regions in the same node and merge contiguous
	 * memblock_regions
	 */
	memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
	memblock_set_node(0, (phys_addr_t)ULLONG_MAX, &memblock.memory, 0);

	/* Add all physical memory to the bootmem map, mark each area
	 * present.
+5 −3
Original line number Diff line number Diff line
@@ -670,7 +670,8 @@ static void __init parse_drconf_memory(struct device_node *memory)
			node_set_online(nid);
			sz = numa_enforce_memory_limit(base, size);
			if (sz)
				memblock_set_node(base, sz, nid);
				memblock_set_node(base, sz,
						  &memblock.memory, nid);
		} while (--ranges);
	}
}
@@ -760,7 +761,7 @@ static int __init parse_numa_properties(void)
				continue;
		}

		memblock_set_node(start, size, nid);
		memblock_set_node(start, size, &memblock.memory, nid);

		if (--ranges)
			goto new_range;
@@ -797,7 +798,8 @@ static void __init setup_nonnuma(void)

		fake_numa_create_new_node(end_pfn, &nid);
		memblock_set_node(PFN_PHYS(start_pfn),
				  PFN_PHYS(end_pfn - start_pfn), nid);
				  PFN_PHYS(end_pfn - start_pfn),
				  &memblock.memory, nid);
		node_set_online(nid);
	}
}
Loading