From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by kanga.kvack.org (Postfix) with ESMTP id DBB3C6B020E for ; Fri, 8 Nov 2013 18:43:26 -0500 (EST) Received: by mail-pd0-f177.google.com with SMTP id p10so2760026pdj.8 for ; Fri, 08 Nov 2013 15:43:26 -0800 (PST) Received: from psmtp.com ([74.125.245.117]) by mx.google.com with SMTP id kg8si8474765pad.38.2013.11.08.15.43.24 for ; Fri, 08 Nov 2013 15:43:25 -0800 (PST) From: Santosh Shilimkar Subject: [PATCH 17/24] mm/hugetlb: Use memblock apis for early memory allocations Date: Fri, 8 Nov 2013 18:41:53 -0500 Message-ID: <1383954120-24368-18-git-send-email-santosh.shilimkar@ti.com> In-Reply-To: <1383954120-24368-1-git-send-email-santosh.shilimkar@ti.com> References: <1383954120-24368-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: tj@kernel.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Grygorii Strashko , Yinghai Lu , Andrew Morton , Santosh Shilimkar From: Grygorii Strashko Switch to memblock interfaces for early memory allocator instead of bootmem allocator. No functional change in beahvior than what it is in current code from bootmem users points of view. Archs already converted to NO_BOOTMEM now directly use memblock interfaces instead of bootmem wrappers build on top of memblock. And the archs which still uses bootmem, these new apis just fallback to exiting bootmem APIs. Cc: Yinghai Lu Cc: Tejun Heo Cc: Andrew Morton Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar --- mm/hugetlb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b49579c..3c9f965 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1282,9 +1282,9 @@ int __weak alloc_bootmem_huge_page(struct hstate *h) for_each_node_mask_to_alloc(h, nr_nodes, node, &node_states[N_MEMORY]) { void *addr; - addr = __alloc_bootmem_node_nopanic(NODE_DATA(node), - huge_page_size(h), huge_page_size(h), 0); - + addr = memblock_virt_alloc_try_nid_nopanic( + huge_page_size(h), huge_page_size(h), + 0, BOOTMEM_ALLOC_ACCESSIBLE, node); if (addr) { /* * Use the beginning of the huge page to store the @@ -1324,8 +1324,8 @@ static void __init gather_bootmem_prealloc(void) #ifdef CONFIG_HIGHMEM page = pfn_to_page(m->phys >> PAGE_SHIFT); - free_bootmem_late((unsigned long)m, - sizeof(struct huge_bootmem_page)); + memblock_free_late(__pa(m), + sizeof(struct huge_bootmem_page)); #else page = virt_to_page(m); #endif -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org