The patch titled Subject: mm/page_alloc: fix build with CONFIG_UNACCEPTED_MEMORY=n has been added to the -mm mm-unstable branch. Its filename is mm-page_alloc-fix-build-with-config_unaccepted_memory=n.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-fix-build-with-config_unaccepted_memory=n.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: mm/page_alloc: fix build with CONFIG_UNACCEPTED_MEMORY=n Date: Thu, 5 Sep 2024 14:22:20 -0700 When has_unaccepted_memory() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: mm/page_alloc.c:7036:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function] 7036 | static inline bool has_unaccepted_memory(void) | ^~~~~~~~~~~~~~~~~~~~~ Fix it by removeing the CONFIG_UNACCEPTED_MEMORY=n stub. Link: https://lkml.kernel.org/r/20240905142220.49d93337a0abce5690e515d9@xxxxxxxxxxxxxxxxxxxx Reported-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Closes: https://lkml.kernel.org/r/20240905171553.275054-1-andriy.shevchenko@xxxxxxxxxxxxxxx Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/mm/page_alloc.c~mm-page_alloc-fix-build-with-config_unaccepted_memory=n +++ a/mm/page_alloc.c @@ -287,7 +287,6 @@ EXPORT_SYMBOL(nr_online_nodes); static bool page_contains_unaccepted(struct page *page, unsigned int order); static bool cond_accept_memory(struct zone *zone, unsigned int order); -static inline bool has_unaccepted_memory(void); static bool __free_unaccepted(struct page *page); int page_group_by_mobility_disabled __read_mostly; @@ -7068,6 +7067,11 @@ static bool try_to_accept_memory_one(str return true; } +static inline bool has_unaccepted_memory(void) +{ + return static_branch_unlikely(&zones_with_unaccepted_pages); +} + static bool cond_accept_memory(struct zone *zone, unsigned int order) { long to_accept; @@ -7095,11 +7099,6 @@ static bool cond_accept_memory(struct zo return ret; } -static inline bool has_unaccepted_memory(void) -{ - return static_branch_unlikely(&zones_with_unaccepted_pages); -} - static bool __free_unaccepted(struct page *page) { struct zone *zone = page_zone(page); @@ -7134,11 +7133,6 @@ static bool cond_accept_memory(struct zo { return false; } - -static inline bool has_unaccepted_memory(void) -{ - return false; -} static bool __free_unaccepted(struct page *page) { _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are mm-count-the-number-of-anonymous-thps-per-size-fix.patch mm-shmem-extend-shmem_unused_huge_shrink-to-all-sizes-fix.patch mm-hugetlb-sort-out-global-lock-annotations-fix.patch mm-hugetlb-sort-out-global-lock-annotations-fix-fix.patch mmtmpfs-consider-end-of-file-write-in-shmem_is_huge-checkpatch-fixes.patch mm-page_alloc-fix-build-with-config_unaccepted_memory=n.patch