Skip to contentSkip to conversation

mm/hugetlb: define replace_free_hugepage_folios() on CONFIG_HUGETLB_PAGE=n as static inline

PATCH New SeongJae Park 1 participant 1 message Dec 19, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/hugetlb: define replace_free_hugepage_folios() on CONFIG_HUGETLB_PAGE=n as static inline

Commit fba5261e0039 ("mm: replace free hugepage folios after migration") on mm-unstable that also available at
https://lkml.kernel.org/r/[email protected]
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")
---
 include/linux/hugetlb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/hugetlb.h +2 -1
index 7d36ac8df97f..10faf42ca96a 100644
@@ -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;
 }
Signature · 1 line
2.39.5