linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM
@ 2018-07-11 19:59 Mike Kravetz
  2018-07-11 20:57 ` Davidlohr Bueso
  2018-07-12  7:47 ` Michal Hocko
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Kravetz @ 2018-07-11 19:59 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Aneesh Kumar K . V, Michael Ellerman, Benjamin Herrenschmidt,
	Michal Hocko, Cannon Matthews, Andrew Morton, Mike Kravetz

This reverts commit ee8f248d266e ("hugetlb: add phys addr to struct
huge_bootmem_page")

At one time powerpc used this field and supporting code. However that
was removed with commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support
for reserving gigantic huge pages via kernel command line").

There are no users of this field and supporting code, so remove it.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
 include/linux/hugetlb.h | 3 ---
 mm/hugetlb.c            | 9 +--------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 36fa6a2a82e3..c39d9170a8a0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -348,9 +348,6 @@ struct hstate {
 struct huge_bootmem_page {
 	struct list_head list;
 	struct hstate *hstate;
-#ifdef CONFIG_HIGHMEM
-	phys_addr_t phys;
-#endif
 };
 
 struct page *alloc_huge_page(struct vm_area_struct *vma,
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 430be42b6ca1..e39593df050b 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2139,16 +2139,9 @@ static void __init gather_bootmem_prealloc(void)
 	struct huge_bootmem_page *m;
 
 	list_for_each_entry(m, &huge_boot_pages, list) {
+		struct page *page = virt_to_page(m);
 		struct hstate *h = m->hstate;
-		struct page *page;
 
-#ifdef CONFIG_HIGHMEM
-		page = pfn_to_page(m->phys >> PAGE_SHIFT);
-		memblock_free_late(__pa(m),
-				   sizeof(struct huge_bootmem_page));
-#else
-		page = virt_to_page(m);
-#endif
 		WARN_ON(page_count(page) != 1);
 		prep_compound_huge_page(page, h->order);
 		WARN_ON(PageReserved(page));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM
  2018-07-11 19:59 [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM Mike Kravetz
@ 2018-07-11 20:57 ` Davidlohr Bueso
  2018-07-11 21:36   ` Mike Kravetz
  2018-07-12  7:47 ` Michal Hocko
  1 sibling, 1 reply; 4+ messages in thread
From: Davidlohr Bueso @ 2018-07-11 20:57 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: linux-mm, linux-kernel, Aneesh Kumar K . V, Michael Ellerman,
	Benjamin Herrenschmidt, Michal Hocko, Cannon Matthews,
	Andrew Morton

On Wed, 11 Jul 2018, Mike Kravetz wrote:

>This reverts commit ee8f248d266e ("hugetlb: add phys addr to struct
>huge_bootmem_page")
>
>At one time powerpc used this field and supporting code. However that
>was removed with commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support
>for reserving gigantic huge pages via kernel command line").
>
>There are no users of this field and supporting code, so remove it.

Considering the title, don't you wanna also get rid of try_to_free_low()
and something like the following, which I'm sure can be done fancier, and
perhaps also thp?

diff --git a/fs/Kconfig b/fs/Kconfig
index ac474a61be37..849da70e35d6 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -192,8 +192,8 @@ config TMPFS_XATTR
 
 config HUGETLBFS
        bool "HugeTLB file system support"
-       depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
-                  SYS_SUPPORTS_HUGETLBFS || BROKEN
+       depends on !HIGHMEM && (X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
+                  SYS_SUPPORTS_HUGETLBFS || BROKEN)
        help
          hugetlbfs is a filesystem backing for HugeTLB pages, based on
          ramfs. For architectures that support it, say Y here and read

Thanks,
Davidlohr

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM
  2018-07-11 20:57 ` Davidlohr Bueso
@ 2018-07-11 21:36   ` Mike Kravetz
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Kravetz @ 2018-07-11 21:36 UTC (permalink / raw)
  To: linux-mm, linux-kernel, Aneesh Kumar K . V, Michael Ellerman,
	Benjamin Herrenschmidt, Michal Hocko, Cannon Matthews,
	Andrew Morton

On 07/11/2018 01:57 PM, Davidlohr Bueso wrote:
> On Wed, 11 Jul 2018, Mike Kravetz wrote:
> 
>> This reverts commit ee8f248d266e ("hugetlb: add phys addr to struct
>> huge_bootmem_page")
>>
>> At one time powerpc used this field and supporting code. However that
>> was removed with commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support
>> for reserving gigantic huge pages via kernel command line").
>>
>> There are no users of this field and supporting code, so remove it.
> 
> Considering the title, don't you wanna also get rid of try_to_free_low()
> and something like the following, which I'm sure can be done fancier, and
> perhaps also thp?

Not really.  The intention is to only remove gigantic huge page support for
HIGHMEN systems.  Non-gigantic huge pages on HIGHMEN systems should still
work/be supported.  So, we do not want to make the config change or get
rid of try_to_free_low().

Actually, I simply wanted to revert the specific patch which enabled gigantic
huge pages on HIGHMEM systems.  I did see that check in try_to_free_low(),

	if (hstate_is_gigantic(h))
		return;

and considered for a minute turning that into a VM_BUG or WARN, but decided
to leave it as is.

Do you think the title should be changed to simply 'revert commit
ee8f248d266e'?

-- 
Mike Kravetz

> diff --git a/fs/Kconfig b/fs/Kconfig
> index ac474a61be37..849da70e35d6 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -192,8 +192,8 @@ config TMPFS_XATTR
> 
> config HUGETLBFS
>        bool "HugeTLB file system support"
> -       depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
> -                  SYS_SUPPORTS_HUGETLBFS || BROKEN
> +       depends on !HIGHMEM && (X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
> +                  SYS_SUPPORTS_HUGETLBFS || BROKEN)
>        help
>          hugetlbfs is a filesystem backing for HugeTLB pages, based on
>          ramfs. For architectures that support it, say Y here and read
> 
> Thanks,
> Davidlohr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM
  2018-07-11 19:59 [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM Mike Kravetz
  2018-07-11 20:57 ` Davidlohr Bueso
@ 2018-07-12  7:47 ` Michal Hocko
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Hocko @ 2018-07-12  7:47 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: linux-mm, linux-kernel, Aneesh Kumar K . V, Michael Ellerman,
	Benjamin Herrenschmidt, Cannon Matthews, Andrew Morton

On Wed 11-07-18 12:59:13, Mike Kravetz wrote:
> This reverts commit ee8f248d266e ("hugetlb: add phys addr to struct
> huge_bootmem_page")
> 
> At one time powerpc used this field and supporting code. However that
> was removed with commit 79cc38ded1e1 ("powerpc/mm/hugetlb: Add support
> for reserving gigantic huge pages via kernel command line").
> 
> There are no users of this field and supporting code, so remove it.
> 
> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  include/linux/hugetlb.h | 3 ---
>  mm/hugetlb.c            | 9 +--------
>  2 files changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 36fa6a2a82e3..c39d9170a8a0 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -348,9 +348,6 @@ struct hstate {
>  struct huge_bootmem_page {
>  	struct list_head list;
>  	struct hstate *hstate;
> -#ifdef CONFIG_HIGHMEM
> -	phys_addr_t phys;
> -#endif
>  };
>  
>  struct page *alloc_huge_page(struct vm_area_struct *vma,
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 430be42b6ca1..e39593df050b 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2139,16 +2139,9 @@ static void __init gather_bootmem_prealloc(void)
>  	struct huge_bootmem_page *m;
>  
>  	list_for_each_entry(m, &huge_boot_pages, list) {
> +		struct page *page = virt_to_page(m);
>  		struct hstate *h = m->hstate;
> -		struct page *page;
>  
> -#ifdef CONFIG_HIGHMEM
> -		page = pfn_to_page(m->phys >> PAGE_SHIFT);
> -		memblock_free_late(__pa(m),
> -				   sizeof(struct huge_bootmem_page));
> -#else
> -		page = virt_to_page(m);
> -#endif
>  		WARN_ON(page_count(page) != 1);
>  		prep_compound_huge_page(page, h->order);
>  		WARN_ON(PageReserved(page));
> -- 
> 2.17.1

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-12  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 19:59 [PATCH] mm/hugetlb: remove gigantic page support for HIGHMEM Mike Kravetz
2018-07-11 20:57 ` Davidlohr Bueso
2018-07-11 21:36   ` Mike Kravetz
2018-07-12  7:47 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).