Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/05/2016 01:14 AM, Kirill A. Shutemov wrote:
>>  include/linux/gfp.h | 6 +++---
>>  mm/hugetlb.c        | 2 +-
>>  mm/page_alloc.c     | 2 +-
>>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> One more place missed: gigantic_pages_init() in arch/x86/mm/hugetlbpage.c
> Could you relax the check there as well?

Crap, thanks. This file was hidden in different commit and didn't cause
compilation failure. Patch below, tested that 1gb pages are available
with COMPACTION+ISOLATION.

----8<----
From: Vlastimil Babka <vbabka@xxxxxxx>
Date: Fri, 5 Feb 2016 10:59:38 +0100
Subject: [PATCH 2/2] 
 mm-hugetlb-dont-require-cma-for-runtime-gigantic-pages-fix2

Update also arch-specific code as Kirill pointed out.

Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
---
 arch/x86/mm/hugetlbpage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 42982b26e32b..740d7ac03a55 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -173,10 +173,10 @@ static __init int setup_hugepagesz(char *opt)
 }
 __setup("hugepagesz=", setup_hugepagesz);
 
-#ifdef CONFIG_CMA
+#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA)
 static __init int gigantic_pages_init(void)
 {
-	/* With CMA we can allocate gigantic pages at runtime */
+	/* With compaction or CMA we can allocate gigantic pages at runtime */
 	if (cpu_has_gbpages && !size_to_hstate(1UL << PUD_SHIFT))
 		hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
 	return 0;
-- 
2.7.0


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]