Message ID | 1378979537-21196-5-git-send-email-tangchen@cn.fujitsu.com (mailing list archive) |
---|---|
State | RFC, archived |
Headers | show |
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index b4e8500..2958118 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -759,9 +759,20 @@ void __init setup_log_buf(int early) if (early) { unsigned long mem; + if (memblock_direction_bottom_up()) { + mem = memblock_alloc_bottom_up( + MEMBLOCK_ALLOC_ACCESSIBLE, + MEMBLOCK_ALLOC_ACCESSIBLE, + new_log_buf_len, PAGE_SIZE); + if (mem) + goto success; + } + mem = memblock_alloc(new_log_buf_len, PAGE_SIZE); if (!mem) return; + +success: new_log_buf = __va(mem); } else { new_log_buf = alloc_bootmem_nopanic(new_log_buf_len);