Skip to content

Commit 562beb7

Browse files
MiaoheLintorvalds
authored andcommitted
mm/huge_memory: make is_transparent_hugepage() static
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 Link: https://lkml.kernel.org/r/20220302082145.12028-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Reviewed-by: Yang Shi <shy828301@gmail.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: William Kucharski <william.kucharski@oracle.com> Cc: Hugh Dickins <hughd@google.com> Cc: Peter Xu <peterx@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9ae8f2b commit 562beb7

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

include/linux/huge_mm.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
183183

184184
void prep_transhuge_page(struct page *page);
185185
void free_transhuge_page(struct page *page);
186-
bool is_transparent_hugepage(struct page *page);
187186

188187
bool can_split_folio(struct folio *folio, int *pextra_pins);
189188
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,
341340

342341
static inline void prep_transhuge_page(struct page *page) {}
343342

344-
static inline bool is_transparent_hugepage(struct page *page)
345-
{
346-
return false;
347-
}
348-
349343
#define transparent_hugepage_flags 0UL
350344

351345
#define thp_get_unmapped_area NULL

mm/huge_memory.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ void prep_transhuge_page(struct page *page)
533533
set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
534534
}
535535

536-
bool is_transparent_hugepage(struct page *page)
536+
static inline bool is_transparent_hugepage(struct page *page)
537537
{
538538
if (!PageCompound(page))
539539
return false;
@@ -542,7 +542,6 @@ bool is_transparent_hugepage(struct page *page)
542542
return is_huge_zero_page(page) ||
543543
page[1].compound_dtor == TRANSHUGE_PAGE_DTOR;
544544
}
545-
EXPORT_SYMBOL_GPL(is_transparent_hugepage);
546545

547546
static unsigned long __thp_get_unmapped_area(struct file *filp,
548547
unsigned long addr, unsigned long len,

0 commit comments

Comments
 (0)