[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1378979537-21196-7-git-send-email-tangchen@cn.fujitsu.com>
Date: Thu, 12 Sep 2013 17:52:14 +0800
From: Tang Chen <tangchen@...fujitsu.com>
To: tj@...nel.org, rjw@...k.pl, lenb@...nel.org, tglx@...utronix.de,
mingo@...e.hu, hpa@...or.com, akpm@...ux-foundation.org,
trenn@...e.de, yinghai@...nel.org, jiang.liu@...wei.com,
wency@...fujitsu.com, laijs@...fujitsu.com,
isimatu.yasuaki@...fujitsu.com, izumi.taku@...fujitsu.com,
mgorman@...e.de, minchan@...nel.org, mina86@...a86.com,
gong.chen@...ux.intel.com, vasilis.liaskovitis@...fitbricks.com,
lwoodman@...hat.com, riel@...hat.com, jweiner@...hat.com,
prarit@...hat.com, zhangyanfei@...fujitsu.com, toshi.kani@...com
Cc: x86@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-acpi@...r.kernel.org
Subject: [RESEND PATCH v2 6/9] x86, acpi: Support allocate memory from bottom upwards in acpi_initrd_override().
During early boot, if the bottom up mode is set, just
try allocating bottom up from the end of kernel image,
and if that fails, do normal top down allocation.
So in function acpi_initrd_override(), we add the
above logic.
Signed-off-by: Tang Chen <tangchen@...fujitsu.com>
Reviewed-by: Zhang Yanfei <zhangyanfei@...fujitsu.com>
---
drivers/acpi/osl.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index e5f416c..978dcfa 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -632,6 +632,15 @@ void __init acpi_initrd_override(void *data, size_t size)
if (table_nr == 0)
return;
+ if (memblock_direction_bottom_up()) {
+ acpi_tables_addr = memblock_alloc_bottom_up(
+ MEMBLOCK_ALLOC_ACCESSIBLE,
+ max_low_pfn_mapped << PAGE_SHIFT,
+ all_tables_size, PAGE_SIZE);
+ if (acpi_tables_addr)
+ goto success;
+ }
+
acpi_tables_addr =
memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT,
all_tables_size, PAGE_SIZE);
@@ -639,6 +648,8 @@ void __init acpi_initrd_override(void *data, size_t size)
WARN_ON(1);
return;
}
+
+success:
/*
* Only calling e820_add_reserve does not work and the
* tables are invalid (memory got used) later.
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists