Hi Guo,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 6c3413fbf8c430b89f5d23f465e10e99ea145199 commit: 107e2b7c4b1d007583efab423cc48429c87c6408 [2579/2579] mm/sharepool: Fix sharepool hugepage cgroup uncount error. config: arm64-randconfig-004-20241213 (https://download.01.org/0day-ci/archive/20241214/202412140941.hd45mfxv-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412140941.hd45mfxv-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/202412140941.hd45mfxv-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/share_pool.c:864:23: warning: no previous prototype for 'find_spg_node_by_spg' [-Wmissing-prototypes] 864 | struct sp_group_node *find_spg_node_by_spg(struct mm_struct *mm, | ^~~~~~~~~~~~~~~~~~~~ mm/share_pool.c: In function 'sp_hugetlb_entry': mm/share_pool.c:3073:21: error: implicit declaration of function 'huge_ptep_get' [-Werror=implicit-function-declaration] 3073 | pte_t pte = huge_ptep_get(ptep); | ^~~~~~~~~~~~~ mm/share_pool.c:3073:21: error: invalid initializer mm/share_pool.c: In function 'sp_unshare_kva': mm/share_pool.c:3450:14: warning: variable 'is_hugepage' set but not used [-Wunused-but-set-variable] 3450 | bool is_hugepage = true; | ^~~~~~~~~~~ mm/share_pool.c: At top level: mm/share_pool.c:3942:6: warning: no previous prototype for 'spa_overview_show' [-Wmissing-prototypes] 3942 | void spa_overview_show(struct seq_file *seq) | ^~~~~~~~~~~~~~~~~ mm/share_pool.c:4024:6: warning: no previous prototype for 'spg_overview_show' [-Wmissing-prototypes] 4024 | void spg_overview_show(struct seq_file *seq) | ^~~~~~~~~~~~~~~~~ mm/share_pool.c: In function 'sharepool_no_page': mm/share_pool.c:4215:41: error: 'HUGETLB_ALLOC_BUDDY' undeclared (first use in this function) 4215 | HUGETLB_ALLOC_BUDDY | HUGETLB_ALLOC_NORECLAIM); | ^~~~~~~~~~~~~~~~~~~ mm/share_pool.c:4215:41: note: each undeclared identifier is reported only once for each function it appears in
mm/share_pool.c:4215:63: error: 'HUGETLB_ALLOC_NORECLAIM' undeclared (first use in this function)
4215 | HUGETLB_ALLOC_BUDDY | HUGETLB_ALLOC_NORECLAIM); | ^~~~~~~~~~~~~~~~~~~~~~~ mm/share_pool.c:4221:30: error: implicit declaration of function 'huge_pte_none'; did you mean 'huge_pte_lock'? [-Werror=implicit-function-declaration] 4221 | if (!huge_pte_none(huge_ptep_get(ptep))) { | ^~~~~~~~~~~~~ | huge_pte_lock mm/share_pool.c:4234:23: error: implicit declaration of function 'huge_add_to_page_cache'; did you mean 'add_to_page_cache'? [-Werror=implicit-function-declaration] 4234 | err = huge_add_to_page_cache(page, mapping, idx); | ^~~~~~~~~~~~~~~~~~~~~~ | add_to_page_cache mm/share_pool.c:4256:9: error: implicit declaration of function 'set_huge_pte_at'; did you mean 'set_huge_swap_pte_at'? [-Werror=implicit-function-declaration] 4256 | set_huge_pte_at(mm, haddr, ptep, new_pte); | ^~~~~~~~~~~~~~~ | set_huge_swap_pte_at mm/share_pool.c:4258:9: error: implicit declaration of function 'hugetlb_count_add'; did you mean 'hugetlb_count_sub'? [-Werror=implicit-function-declaration] 4258 | hugetlb_count_add(pages_per_huge_page(h), mm); | ^~~~~~~~~~~~~~~~~ | hugetlb_count_sub mm/share_pool.c: At top level: mm/share_pool.c:4119:12: warning: 'proc_usage_show' defined but not used [-Wunused-function] 4119 | static int proc_usage_show(struct seq_file *seq, void *offset) | ^~~~~~~~~~~~~~~ mm/share_pool.c:4097:12: warning: 'proc_group_usage_show' defined but not used [-Wunused-function] 4097 | static int proc_group_usage_show(struct seq_file *seq, void *offset) | ^~~~~~~~~~~~~~~~~~~~~ mm/share_pool.c:4049:12: warning: 'spa_stat_show' defined but not used [-Wunused-function] 4049 | static int spa_stat_show(struct seq_file *seq, void *offset) | ^~~~~~~~~~~~~ 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 +/HUGETLB_ALLOC_NORECLAIM +4215 mm/share_pool.c
4180 4181 vm_fault_t sharepool_no_page(struct mm_struct *mm, 4182 struct vm_area_struct *vma, 4183 struct address_space *mapping, pgoff_t idx, 4184 unsigned long address, pte_t *ptep, unsigned int flags) 4185 { 4186 struct hstate *h = hstate_vma(vma); 4187 vm_fault_t ret = VM_FAULT_SIGBUS; 4188 unsigned long size; 4189 struct page *page; 4190 pte_t new_pte; 4191 spinlock_t *ptl; 4192 unsigned long haddr = address & huge_page_mask(h); 4193 bool new_page = false; 4194 int err; 4195 int node_id; 4196 struct sp_area *spa; 4197 4198 spa = vma->vm_private_data; 4199 if (!spa) { 4200 pr_err("share pool: vma is invalid, not from sp mmap\n"); 4201 return ret; 4202 } 4203 node_id = spa->node_id; 4204 4205 retry: 4206 page = find_lock_page(mapping, idx); 4207 if (!page) { 4208 size = i_size_read(mapping->host) >> huge_page_shift(h); 4209 if (idx >= size) 4210 goto out; 4211 4212 page = alloc_huge_page(vma, haddr, 0); 4213 if (IS_ERR(page)) { 4214 page = hugetlb_alloc_hugepage(node_id,
4215 HUGETLB_ALLOC_BUDDY | HUGETLB_ALLOC_NORECLAIM);
4216 if (!page) 4217 page = ERR_PTR(-ENOMEM); 4218 } 4219 if (IS_ERR(page)) { 4220 ptl = huge_pte_lock(h, mm, ptep); 4221 if (!huge_pte_none(huge_ptep_get(ptep))) { 4222 ret = 0; 4223 spin_unlock(ptl); 4224 goto out; 4225 } 4226 spin_unlock(ptl); 4227 ret = vmf_error(PTR_ERR(page)); 4228 goto out; 4229 } 4230 __SetPageUptodate(page); 4231 new_page = true; 4232 4233 /* sharepool pages are all shared */ 4234 err = huge_add_to_page_cache(page, mapping, idx); 4235 if (err) { 4236 put_page(page); 4237 if (err == -EEXIST) 4238 goto retry; 4239 goto out; 4240 } 4241 } 4242 4243 4244 ptl = huge_pte_lock(h, mm, ptep); 4245 size = i_size_read(mapping->host) >> huge_page_shift(h); 4246 if (idx >= size) 4247 goto backout; 4248 4249 ret = 0; 4250 if (!huge_pte_none(huge_ptep_get(ptep))) 4251 goto backout; 4252 4253 page_dup_rmap(page, true); 4254 new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) 4255 && (vma->vm_flags & VM_SHARED))); 4256 set_huge_pte_at(mm, haddr, ptep, new_pte); 4257 4258 hugetlb_count_add(pages_per_huge_page(h), mm); 4259 4260 spin_unlock(ptl); 4261 4262 if (new_page) { 4263 SetPagePrivate(&page[1]); 4264 } 4265 4266 unlock_page(page); 4267 out: 4268 return ret; 4269 4270 backout: 4271 spin_unlock(ptl); 4272 unlock_page(page); 4273 put_page(page); 4274 goto out; 4275 } 4276