tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 40e02117ca786975378e324ac2e14cc00b00206e commit: 2125c55fc8765bced7091ccef19d2733a9ad9de0 [3301/3301] zcopy: Extend PMD trans hugepage mapping ability config: arm64-randconfig-002-20251123 (https://download.01.org/0day-ci/archive/20251123/202511230145.Q8A14oTe-lkp@i...) compiler: aarch64-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251123/202511230145.Q8A14oTe-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/202511230145.Q8A14oTe-lkp@intel.com/ All warnings (new ones prefixed by >>):
drivers/misc/zcopy/zcopy.c:259:5: warning: no previous prototype for 'attach_huge_pmd' [-Wmissing-prototypes] 259 | int attach_huge_pmd(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, | ^~~~~~~~~~~~~~~
vim +/attach_huge_pmd +259 drivers/misc/zcopy/zcopy.c 258
259 int attach_huge_pmd(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, 260 unsigned long dst_addr, unsigned long src_addr, pmd_t *dst_pmdp, pmd_t *src_pmdp) 261 { 262 struct mm_struct *dst_mm, *src_mm; 263 spinlock_t *src_ptl, *dst_ptl; 264 struct page *src_thp_page, *orig_thp_page; 265 pmd_t pmd, orig_pmd; 266 pgtable_t pgtable; 267 268 269 if (!vma_is_anonymous(dst_vma)) 270 return -EINVAL; 271 272 dst_mm = dst_vma->vm_mm; 273 src_mm = src_vma->vm_mm; 274 275 /* alloc a pgtable for new pmdp */ 276 pgtable = pte_alloc_one(dst_mm); 277 if (unlikely(!pgtable)) 278 return -ENOMEM; 279 280 src_ptl = pmd_lockptr(src_mm, src_pmdp); 281 dst_ptl = pmd_lockptr(dst_mm, dst_pmdp); 282 283 spin_lock(src_ptl); 284 pmd = *src_pmdp; 285 src_thp_page = pmd_page(pmd); 286 if (unlikely(!PageHead(src_thp_page))) { 287 pr_err("VM assertion failed: it is not a head page\n"); 288 spin_unlock(src_ptl); 289 return -EINVAL; 290 } 291 292 get_page(src_thp_page); 293 atomic_inc(compound_mapcount_ptr(src_thp_page)); 294 spin_unlock(src_ptl); 295 296 spin_lock_nested(dst_ptl, SINGLE_DEPTH_NESTING); 297 orig_pmd = *dst_pmdp; 298 /* umap the old page mappings */ 299 if (!pmd_none(orig_pmd)) { 300 orig_thp_page = pmd_page(orig_pmd); 301 put_page(orig_thp_page); 302 atomic_dec(compound_mapcount_ptr(orig_thp_page)); 303 zcopy_add_mm_counter(dst_mm, MM_ANONPAGES, -HPAGE_PMD_NR); 304 mm_dec_nr_ptes(dst_mm); 305 } 306 307 zcopy_add_mm_counter(dst_mm, MM_ANONPAGES, HPAGE_PMD_NR); 308 mm_inc_nr_ptes(dst_mm); 309 zcopy_pgtable_trans_huge_deposit(dst_mm, dst_pmdp, pgtable); 310 zcopy_set_pmd_at(dst_mm, dst_addr, dst_pmdp, pmd); 311 flush_tlb_range(dst_vma, dst_addr, dst_addr + HPAGE_PMD_SIZE); 312 spin_unlock(dst_ptl); 313 314 return 0; 315 } 316
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki