Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327625

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

From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages
Date 2016-02-05 13:10 +0100
Message-ID <qYNn4-8os-11@gated-at.bofh.it> (permalink)
References <qY9SG-58b-17@gated-at.bofh.it> <qYlh9-4Ml-11@gated-at.bofh.it> <qYoym-6KS-5@gated-at.bofh.it> <qYpb4-7ep-9@gated-at.bofh.it> <qYChZ-XM-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@suse.cz>
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@suse.cz>
---
 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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages Vlastimil Babka <vbabka@suse.cz> - 2016-02-03 19:00 +0100
  Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-02-04 07:10 +0100
    Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages Vlastimil Babka <vbabka@suse.cz> - 2016-02-04 10:40 +0100
      Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages Vlastimil Babka <vbabka@suse.cz> - 2016-02-04 11:20 +0100
        Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-02-05 01:20 +0100
          Re: [PATCH] mm, hugetlb: don't require CMA for runtime gigantic pages Vlastimil Babka <vbabka@suse.cz> - 2016-02-05 13:10 +0100

csiph-web