From patchwork Fri Mar 25 01:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12791198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E2EBC433F5 for ; Fri, 25 Mar 2022 01:13:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13F0E8D0038; Thu, 24 Mar 2022 21:13:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A0838D0005; Thu, 24 Mar 2022 21:13:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED1BA8D0038; Thu, 24 Mar 2022 21:13:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id D8CBD8D0005 for ; Thu, 24 Mar 2022 21:13:29 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 97F371828D834 for ; Fri, 25 Mar 2022 01:13:29 +0000 (UTC) X-FDA: 79281135738.24.1149C60 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 3E65220029 for ; Fri, 25 Mar 2022 01:13:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A302A61857; Fri, 25 Mar 2022 01:13:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01A31C340EE; Fri, 25 Mar 2022 01:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1648170808; bh=Bg3plHV89qnMDf1nib8RtzEZpsi+NIFHvXU485tLLC8=; h=Date:To:From:In-Reply-To:Subject:From; b=ArP9H+YQxuUUnT9h1UBtLOcjjk4JSjPgqboD11c42Hi+QZNfftgScDsany0xbj2tH gmPjONCCWvvsBbpVGCpyztawQJKhPUHaQwvdpiIAR2M9rZIdb6YToks9gwJ4DWHr44 sALKAZCgIuBEcWMqAplA+b1OmbMrlnwtMpEDj2ec= Date: Thu, 24 Mar 2022 18:13:27 -0700 To: willy@infradead.org,william.kucharski@oracle.com,songmuchun@bytedance.com,shy828301@gmail.com,peterx@redhat.com,hughd@google.com,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220324180758.96b1ac7e17675d6bc474485e@linux-foundation.org> Subject: [patch 098/114] mm/huge_memory: make is_transparent_hugepage() static Message-Id: <20220325011328.01A31C340EE@smtp.kernel.org> X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ArP9H+YQ; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3E65220029 X-Stat-Signature: xmjuzaaahsdapxk5s94iz5rhri71e9yf X-HE-Tag: 1648170809-217293 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miaohe Lin Subject: 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 Reviewed-by: Muchun Song Reviewed-by: Yang Shi Cc: Matthew Wilcox Cc: William Kucharski Cc: Hugh Dickins Cc: Peter Xu Signed-off-by: Andrew Morton --- include/linux/huge_mm.h | 6 ------ mm/huge_memory.c | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) --- a/include/linux/huge_mm.h~mm-huge_memory-make-is_transparent_hugepage-static +++ a/include/linux/huge_mm.h @@ -183,7 +183,6 @@ unsigned long thp_get_unmapped_area(stru 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 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 --- a/mm/huge_memory.c~mm-huge_memory-make-is_transparent_hugepage-static +++ a/mm/huge_memory.c @@ -533,7 +533,7 @@ void prep_transhuge_page(struct page *pa 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 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,