All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: yangge <yangge1116@126.com>, Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH mm-unstable] mm/hugetlb: define replace_free_hugepage_folios() on CONFIG_HUGETLB_PAGE=n as static inline
Date: Thu, 19 Dec 2024 10:37:53 -0800	[thread overview]
Message-ID: <20241219183753.62922-1-sj@kernel.org> (raw)

Commit fba5261e0039 ("mm: replace free hugepage folios after migration")
on mm-unstable that also available at
https://lkml.kernel.org/r/1734503588-16254-1-git-send-email-yangge1116@126.com
breaks build when CONFIG_HUGETLB_PAGE=n as below, since
replace_free_hugepage_folios() is defined on the header as non-inline.
Fix it.

    ./tools/testing/kunit/kunit.py run --kunitconfig mm/damon/tests --build_dir ../kunit.out
    [...]
    ld: io_uring/rsrc.o: in function `replace_free_hugepage_folios':
    rsrc.c:(.text+0x160): multiple definition of `replace_free_hugepage_folios'; kernel/fork.o:fork.c:(.text+0xc30): first defined here
    [...]
    make: *** [Makefile:251: __sub-make] Error 2

Fixes: fba5261e0039 ("mm: replace free hugepage folios after migration")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 include/linux/hugetlb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 7d36ac8df97f..10faf42ca96a 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1060,7 +1060,8 @@ static inline int isolate_or_dissolve_huge_page(struct page *page,
 	return -ENOMEM;
 }
 
-int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn)
+static inline int replace_free_hugepage_folios(unsigned long start_pfn,
+		unsigned long end_pfn)
 {
 	return 0;
 }
-- 
2.39.5


                 reply	other threads:[~2024-12-19 18:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241219183753.62922-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=yangge1116@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.