@@ -326,6 +326,15 @@ static void __init relocate_initrd(void)
char *p, *q;
/* We need to move the initrd down into directly mapped mem */
+ if (memblock_direction_bottom_up()) {
+ ramdisk_here = memblock_alloc_bottom_up(
+ MEMBLOCK_ALLOC_ACCESSIBLE,
+ PFN_PHYS(max_pfn_mapped),
+ area_size, PAGE_SIZE);
+ if (ramdisk_here)
+ goto success;
+ }
+
ramdisk_here = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
area_size, PAGE_SIZE);
@@ -333,6 +342,7 @@ static void __init relocate_initrd(void)
panic("Cannot find place for new RAMDISK of size %lld\n",
ramdisk_size);
+success:
/* Note: this includes all the mem currently occupied by
the initrd, we rely on that fact to keep the data intact. */
memblock_reserve(ramdisk_here, area_size);