Hi Chen,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 8f53b22e47e98837db7830541a369ed0cd5df749 commit: 8deff3a60ce1a9dffb552210f065fc9ed6a55f84 [17535/30000] mm/sharepool: Add mg_sp_alloc_nodemask config: arm64-randconfig-004-20240912 (https://download.01.org/0day-ci/archive/20240912/202409121903.R7e8tX7R-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240912/202409121903.R7e8tX7R-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409121903.R7e8tX7R-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/share_pool.c:2573:7: warning: no previous prototype for '__mg_sp_alloc_nodemask' [-Wmissing-prototypes]
2573 | void *__mg_sp_alloc_nodemask(unsigned long size, unsigned long sp_flags, int spg_id, | ^~~~~~~~~~~~~~~~~~~~~~ mm/share_pool.c: In function 'sp_hugetlb_entry': mm/share_pool.c:3037:21: error: implicit declaration of function 'huge_ptep_get' [-Werror=implicit-function-declaration] 3037 | pte_t pte = huge_ptep_get(ptep); | ^~~~~~~~~~~~~ mm/share_pool.c:3037:21: error: invalid initializer mm/share_pool.c: In function 'sp_unshare_kva': mm/share_pool.c:3355:14: warning: variable 'is_hugepage' set but not used [-Wunused-but-set-variable] 3355 | bool is_hugepage = true; | ^~~~~~~~~~~ mm/share_pool.c: In function 'sharepool_no_page': mm/share_pool.c:4071:41: error: 'HUGETLB_ALLOC_BUDDY' undeclared (first use in this function) 4071 | HUGETLB_ALLOC_BUDDY | HUGETLB_ALLOC_NORECLAIM); | ^~~~~~~~~~~~~~~~~~~ mm/share_pool.c:4071:41: note: each undeclared identifier is reported only once for each function it appears in mm/share_pool.c:4071:63: error: 'HUGETLB_ALLOC_NORECLAIM' undeclared (first use in this function) 4071 | HUGETLB_ALLOC_BUDDY | HUGETLB_ALLOC_NORECLAIM); | ^~~~~~~~~~~~~~~~~~~~~~~ mm/share_pool.c:4079:30: error: implicit declaration of function 'huge_pte_none'; did you mean 'huge_pte_lock'? [-Werror=implicit-function-declaration] 4079 | if (!huge_pte_none(huge_ptep_get(ptep))) { | ^~~~~~~~~~~~~ | huge_pte_lock mm/share_pool.c:4099:23: error: implicit declaration of function 'huge_add_to_page_cache'; did you mean 'add_to_page_cache'? [-Werror=implicit-function-declaration] 4099 | err = huge_add_to_page_cache(page, mapping, idx); | ^~~~~~~~~~~~~~~~~~~~~~ | add_to_page_cache mm/share_pool.c:4121:9: error: implicit declaration of function 'set_huge_pte_at'; did you mean 'set_huge_swap_pte_at'? [-Werror=implicit-function-declaration] 4121 | set_huge_pte_at(mm, haddr, ptep, new_pte); | ^~~~~~~~~~~~~~~ | set_huge_swap_pte_at mm/share_pool.c:4123:9: error: implicit declaration of function 'hugetlb_count_add'; did you mean 'hugetlb_count_sub'? [-Werror=implicit-function-declaration] 4123 | hugetlb_count_add(pages_per_huge_page(h), mm); | ^~~~~~~~~~~~~~~~~ | hugetlb_count_sub cc1: some warnings being treated as errors
Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for PGP_KEY_PARSER Depends on [n]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y] && ASYMMETRIC_PUBLIC_KEY_SUBTYPE [=n] Selected by [y]: - PGP_PRELOAD [=y] && CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y]
vim +/__mg_sp_alloc_nodemask +2573 mm/share_pool.c
2572
2573 void *__mg_sp_alloc_nodemask(unsigned long size, unsigned long sp_flags, int spg_id,
2574 nodemask_t *nodemask) 2575 { 2576 struct sp_area *spa = NULL; 2577 int ret = 0; 2578 struct sp_alloc_context ac; 2579 2580 if (!sp_is_enabled()) 2581 return ERR_PTR(-EOPNOTSUPP); 2582 2583 ret = sp_alloc_prepare(size, sp_flags, spg_id, &ac); 2584 if (ret) 2585 return ERR_PTR(ret); 2586 2587 try_again: 2588 spa = sp_alloc_area(ac.size_aligned, ac.sp_flags, ac.spg, 2589 ac.type, current->tgid); 2590 if (IS_ERR(spa)) { 2591 pr_err_ratelimited("alloc spa failed in allocation(potential no enough virtual memory when -75): %ld\n", 2592 PTR_ERR(spa)); 2593 ret = PTR_ERR(spa); 2594 goto out; 2595 } 2596 2597 ret = sp_alloc_mmap_populate(spa, &ac, nodemask); 2598 if (ret && ac.state == ALLOC_RETRY) { 2599 /* 2600 * The mempolicy for shared memory is located at backend file, which varies 2601 * between normal pages and huge pages. So we should set the mbind policy again 2602 * when we retry using normal pages. 2603 */ 2604 ac.have_mbind = false; 2605 goto try_again; 2606 } 2607 2608 out: 2609 sp_alloc_finish(ret, spa, &ac); 2610 if (ret) 2611 return ERR_PTR(ret); 2612 else 2613 return (void *)(spa->va_start); 2614 } 2615