Hi Kefeng, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v6.1] [cannot apply to akpm-mm/mm-everything next-20221213] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/mm-converted-page-idle-and-damon-to-use-folios/20221213-171230 patch link: https://lore.kernel.org/r/20221213092735.187924-2-wangkefeng.wang%40huawei.com patch subject: [PATCH -next 1/8] mm: memory_hotplug: add pfn_to_online_folio() config: i386-randconfig-a001 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/6549c7ce5345695320d1dadef2aceff6e76d34f4 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Kefeng-Wang/mm-converted-page-idle-and-damon-to-use-folios/20221213-171230 git checkout 6549c7ce5345695320d1dadef2aceff6e76d34f4 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 prepare If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): In file included from include/linux/mmzone.h:1245, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/linux/memory_hotplug.h: In function 'pfn_to_online_folio': include/linux/memory_hotplug.h:230:13: error: implicit declaration of function 'pfn_valid' [-Werror=implicit-function-declaration] 230 | if (pfn_valid(pfn)) \ | ^~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ In file included from arch/x86/include/asm/page.h:86, from arch/x86/include/asm/thread_info.h:12, from include/linux/thread_info.h:60, from arch/x86/include/asm/preempt.h:7, from include/linux/preempt.h:78, from include/linux/spinlock.h:56, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: >> include/asm-generic/memory_model.h:41:37: error: implicit declaration of function '__pfn_to_section' [-Werror=implicit-function-declaration] 41 | struct mem_section *__sec = __pfn_to_section(__pfn); \ | ^~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ >> include/asm-generic/memory_model.h:41:37: warning: initialization of 'struct mem_section *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 41 | struct mem_section *__sec = __pfn_to_section(__pfn); \ | ^~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:41:37: note: (near initialization for 'page') 41 | struct mem_section *__sec = __pfn_to_section(__pfn); \ | ^~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ >> include/asm-generic/memory_model.h:42:9: error: implicit declaration of function '__section_mem_map_addr' [-Werror=implicit-function-declaration] 42 | __section_mem_map_addr(__sec) + __pfn; \ | ^~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/mmzone.h:1245, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: >> include/linux/memory_hotplug.h:231:25: warning: assignment to 'struct page *' from 'long unsigned int' makes pointer from integer without a cast [-Wint-conversion] 231 | ___page = pfn_to_page(pfn); \ | ^ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/linux/mmzone.h: At top level: >> include/linux/mmzone.h:1740:28: error: conflicting types for '__section_mem_map_addr'; have 'struct page *(struct mem_section *)' 1740 | static inline struct page *__section_mem_map_addr(struct mem_section *section) | ^~~~~~~~~~~~~~~~~~~~~~ In file included from arch/x86/include/asm/page.h:86, from arch/x86/include/asm/thread_info.h:12, from include/linux/thread_info.h:60, from arch/x86/include/asm/preempt.h:7, from include/linux/preempt.h:78, from include/linux/spinlock.h:56, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/asm-generic/memory_model.h:42:9: note: previous implicit declaration of '__section_mem_map_addr' with type 'int()' 42 | __section_mem_map_addr(__sec) + __pfn; \ | ^~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: >> include/linux/mmzone.h:1801:35: error: conflicting types for '__pfn_to_section'; have 'struct mem_section *(long unsigned int)' 1801 | static inline struct mem_section *__pfn_to_section(unsigned long pfn) | ^~~~~~~~~~~~~~~~ In file included from arch/x86/include/asm/page.h:86, from arch/x86/include/asm/thread_info.h:12, from include/linux/thread_info.h:60, from arch/x86/include/asm/preempt.h:7, from include/linux/preempt.h:78, from include/linux/spinlock.h:56, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/asm-generic/memory_model.h:41:37: note: previous implicit declaration of '__pfn_to_section' with type 'int()' 41 | struct mem_section *__sec = __pfn_to_section(__pfn); \ | ^~~~~~~~~~~~~~~~ include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page' 53 | #define pfn_to_page __pfn_to_page | ^~~~~~~~~~~~~ include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page' 231 | ___page = pfn_to_page(pfn); \ | ^~~~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/linux/mmzone.h:1839:19: error: static declaration of 'pfn_valid' follows non-static declaration 1839 | static inline int pfn_valid(unsigned long pfn) | ^~~~~~~~~ In file included from include/linux/mmzone.h:1245, from include/linux/gfp.h:7, from include/linux/slab.h:15, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: include/linux/memory_hotplug.h:230:13: note: previous implicit declaration of 'pfn_valid' with type 'int()' 230 | if (pfn_valid(pfn)) \ | ^~~~~~~~~ include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page' 270 | struct page *page = pfn_to_online_page(pfn); | ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:118: arch/x86/kernel/asm-offsets.s] Error 1 make[2]: Target 'prepare' not remade because of errors. make[1]: *** [Makefile:1272: prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:231: __sub-make] Error 2 make: Target 'prepare' not remade because of errors. vim +231 include/linux/memory_hotplug.h b4a0215e11dcfe Kefeng Wang 2022-08-27 225 208d54e5513c0c Dave Hansen 2005-10-29 226 #else /* ! CONFIG_MEMORY_HOTPLUG */ 2d070eab2e8270 Michal Hocko 2017-07-06 227 #define pfn_to_online_page(pfn) \ 2d070eab2e8270 Michal Hocko 2017-07-06 228 ({ \ 2d070eab2e8270 Michal Hocko 2017-07-06 229 struct page *___page = NULL; \ 2d070eab2e8270 Michal Hocko 2017-07-06 230 if (pfn_valid(pfn)) \ 2d070eab2e8270 Michal Hocko 2017-07-06 @231 ___page = pfn_to_page(pfn); \ 2d070eab2e8270 Michal Hocko 2017-07-06 232 ___page; \ 2d070eab2e8270 Michal Hocko 2017-07-06 233 }) 2d070eab2e8270 Michal Hocko 2017-07-06 234 -- 0-DAY CI Kernel Test Service https://01.org/lkp