linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/huge_memory: make is_transparent_hugepage() static
@ 2022-03-02  8:21 Miaohe Lin
  2022-03-02  9:04 ` Muchun Song
  2022-03-02 18:24 ` Yang Shi
  0 siblings, 2 replies; 3+ messages in thread
From: Miaohe Lin @ 2022-03-02  8:21 UTC (permalink / raw)
  To: akpm
  Cc: willy, shy828301, william.kucharski, hughd, peterx, linux-mm,
	linux-kernel, linmiaohe

It's only used inside the huge_memory.c now. Don't export it and make
it static. We can thus reduce the size of huge_memory.o a bit.

Without this patch:
   text	   data	    bss	    dec	    hex	filename
  32319	   2965	      4	  35288	   89d8	mm/huge_memory.o

With this patch:
   text	   data	    bss	    dec	    hex	filename
  32042	   2957	      4	  35003	   88bb	mm/huge_memory.o

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 include/linux/huge_mm.h | 6 ------
 mm/huge_memory.c        | 3 +--
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 0734aff8fa19..2999190adc22 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -183,7 +183,6 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
 
 void prep_transhuge_page(struct page *page);
 void free_transhuge_page(struct page *page);
-bool is_transparent_hugepage(struct page *page);
 
 bool can_split_folio(struct folio *folio, int *pextra_pins);
 int split_huge_page_to_list(struct page *page, struct list_head *list);
@@ -341,11 +340,6 @@ static inline bool transhuge_vma_enabled(struct vm_area_struct *vma,
 
 static inline void prep_transhuge_page(struct page *page) {}
 
-static inline bool is_transparent_hugepage(struct page *page)
-{
-	return false;
-}
-
 #define transparent_hugepage_flags 0UL
 
 #define thp_get_unmapped_area	NULL
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index b49e1a11df2e..592588825c07 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -533,7 +533,7 @@ void prep_transhuge_page(struct page *page)
 	set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
 }
 
-bool is_transparent_hugepage(struct page *page)
+static inline bool is_transparent_hugepage(struct page *page)
 {
 	if (!PageCompound(page))
 		return false;
@@ -542,7 +542,6 @@ bool is_transparent_hugepage(struct page *page)
 	return is_huge_zero_page(page) ||
 	       page[1].compound_dtor == TRANSHUGE_PAGE_DTOR;
 }
-EXPORT_SYMBOL_GPL(is_transparent_hugepage);
 
 static unsigned long __thp_get_unmapped_area(struct file *filp,
 		unsigned long addr, unsigned long len,
-- 
2.23.0


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

* Re: [PATCH] mm/huge_memory: make is_transparent_hugepage() static
  2022-03-02  8:21 [PATCH] mm/huge_memory: make is_transparent_hugepage() static Miaohe Lin
@ 2022-03-02  9:04 ` Muchun Song
  2022-03-02 18:24 ` Yang Shi
  1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-03-02  9:04 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: Andrew Morton, Matthew Wilcox, Yang Shi, william.kucharski,
	Hugh Dickins, Peter Xu, Linux Memory Management List, LKML

On Wed, Mar 2, 2022 at 4:22 PM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> It's only used inside the huge_memory.c now. Don't export it and make
> it static. We can thus reduce the size of huge_memory.o a bit.
>
> Without this patch:
>    text    data     bss     dec     hex filename
>   32319    2965       4   35288    89d8 mm/huge_memory.o
>
> With this patch:
>    text    data     bss     dec     hex filename
>   32042    2957       4   35003    88bb mm/huge_memory.o
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

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

* Re: [PATCH] mm/huge_memory: make is_transparent_hugepage() static
  2022-03-02  8:21 [PATCH] mm/huge_memory: make is_transparent_hugepage() static Miaohe Lin
  2022-03-02  9:04 ` Muchun Song
@ 2022-03-02 18:24 ` Yang Shi
  1 sibling, 0 replies; 3+ messages in thread
From: Yang Shi @ 2022-03-02 18:24 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: Andrew Morton, Matthew Wilcox, William Kucharski, Hugh Dickins,
	Peter Xu, Linux MM, Linux Kernel Mailing List

On Wed, Mar 2, 2022 at 12:22 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> It's only used inside the huge_memory.c now. Don't export it and make
> it static. We can thus reduce the size of huge_memory.o a bit.
>
> Without this patch:
>    text    data     bss     dec     hex filename
>   32319    2965       4   35288    89d8 mm/huge_memory.o
>
> With this patch:
>    text    data     bss     dec     hex filename
>   32042    2957       4   35003    88bb mm/huge_memory.o
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Yang Shi <shy828301@gmail.com>

> ---
>  include/linux/huge_mm.h | 6 ------
>  mm/huge_memory.c        | 3 +--
>  2 files changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
> index 0734aff8fa19..2999190adc22 100644
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -183,7 +183,6 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
>
>  void prep_transhuge_page(struct page *page);
>  void free_transhuge_page(struct page *page);
> -bool is_transparent_hugepage(struct page *page);
>
>  bool can_split_folio(struct folio *folio, int *pextra_pins);
>  int split_huge_page_to_list(struct page *page, struct list_head *list);
> @@ -341,11 +340,6 @@ static inline bool transhuge_vma_enabled(struct vm_area_struct *vma,
>
>  static inline void prep_transhuge_page(struct page *page) {}
>
> -static inline bool is_transparent_hugepage(struct page *page)
> -{
> -       return false;
> -}
> -
>  #define transparent_hugepage_flags 0UL
>
>  #define thp_get_unmapped_area  NULL
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index b49e1a11df2e..592588825c07 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -533,7 +533,7 @@ void prep_transhuge_page(struct page *page)
>         set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
>  }
>
> -bool is_transparent_hugepage(struct page *page)
> +static inline bool is_transparent_hugepage(struct page *page)
>  {
>         if (!PageCompound(page))
>                 return false;
> @@ -542,7 +542,6 @@ bool is_transparent_hugepage(struct page *page)
>         return is_huge_zero_page(page) ||
>                page[1].compound_dtor == TRANSHUGE_PAGE_DTOR;
>  }
> -EXPORT_SYMBOL_GPL(is_transparent_hugepage);
>
>  static unsigned long __thp_get_unmapped_area(struct file *filp,
>                 unsigned long addr, unsigned long len,
> --
> 2.23.0
>

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

end of thread, other threads:[~2022-03-02 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02  8:21 [PATCH] mm/huge_memory: make is_transparent_hugepage() static Miaohe Lin
2022-03-02  9:04 ` Muchun Song
2022-03-02 18:24 ` Yang Shi

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).