mm/page_alloc.c: rework code layout in memmap_init_zone()
This function is getting full of weird tricks to avoid word-wrapping. Use a goto to eliminate a tab stop then use the new space Cc: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
342332e6a9
commit
b72d0ffb5d
@ -4508,54 +4508,51 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
|
|||||||
|
|
||||||
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
|
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
|
||||||
/*
|
/*
|
||||||
* There can be holes in boot-time mem_map[]s
|
* There can be holes in boot-time mem_map[]s handed to this
|
||||||
* handed to this function. They do not
|
* function. They do not exist on hotplugged memory.
|
||||||
* exist on hotplugged memory.
|
|
||||||
*/
|
*/
|
||||||
if (context == MEMMAP_EARLY) {
|
if (context != MEMMAP_EARLY)
|
||||||
if (!early_pfn_valid(pfn))
|
goto not_early;
|
||||||
continue;
|
|
||||||
if (!early_pfn_in_nid(pfn, nid))
|
if (!early_pfn_valid(pfn))
|
||||||
continue;
|
continue;
|
||||||
if (!update_defer_init(pgdat, pfn, end_pfn,
|
if (!early_pfn_in_nid(pfn, nid))
|
||||||
&nr_initialised))
|
continue;
|
||||||
break;
|
if (!update_defer_init(pgdat, pfn, end_pfn, &nr_initialised))
|
||||||
|
break;
|
||||||
|
|
||||||
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
|
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
|
||||||
/*
|
/*
|
||||||
* if not mirrored_kernelcore and ZONE_MOVABLE exists,
|
* If not mirrored_kernelcore and ZONE_MOVABLE exists, range
|
||||||
* range from zone_movable_pfn[nid] to end of each node
|
* from zone_movable_pfn[nid] to end of each node should be
|
||||||
* should be ZONE_MOVABLE not ZONE_NORMAL. skip it.
|
* ZONE_MOVABLE not ZONE_NORMAL. skip it.
|
||||||
*/
|
*/
|
||||||
if (!mirrored_kernelcore && zone_movable_pfn[nid])
|
if (!mirrored_kernelcore && zone_movable_pfn[nid])
|
||||||
if (zone == ZONE_NORMAL &&
|
if (zone == ZONE_NORMAL && pfn >= zone_movable_pfn[nid])
|
||||||
pfn >= zone_movable_pfn[nid])
|
continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check given memblock attribute by firmware which
|
* Check given memblock attribute by firmware which can affect
|
||||||
* can affect kernel memory layout.
|
* kernel memory layout. If zone==ZONE_MOVABLE but memory is
|
||||||
* if zone==ZONE_MOVABLE but memory is mirrored,
|
* mirrored, it's an overlapped memmap init. skip it.
|
||||||
* it's an overlapped memmap init. skip it.
|
*/
|
||||||
*/
|
if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
|
||||||
if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
|
if (!r || pfn >= memblock_region_memory_end_pfn(r)) {
|
||||||
if (!r ||
|
for_each_memblock(memory, tmp)
|
||||||
pfn >= memblock_region_memory_end_pfn(r)) {
|
if (pfn < memblock_region_memory_end_pfn(tmp))
|
||||||
for_each_memblock(memory, tmp)
|
break;
|
||||||
if (pfn < memblock_region_memory_end_pfn(tmp))
|
r = tmp;
|
||||||
break;
|
}
|
||||||
r = tmp;
|
if (pfn >= memblock_region_memory_base_pfn(r) &&
|
||||||
}
|
memblock_is_mirror(r)) {
|
||||||
if (pfn >= memblock_region_memory_base_pfn(r) &&
|
/* already initialized as NORMAL */
|
||||||
memblock_is_mirror(r)) {
|
pfn = memblock_region_memory_end_pfn(r);
|
||||||
/* already initialized as NORMAL */
|
continue;
|
||||||
pfn = memblock_region_memory_end_pfn(r);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
not_early:
|
||||||
/*
|
/*
|
||||||
* Mark the block movable so that blocks are reserved for
|
* Mark the block movable so that blocks are reserved for
|
||||||
* movable at startup. This will force kernel allocations
|
* movable at startup. This will force kernel allocations
|
||||||
|
Loading…
Reference in New Issue
Block a user