tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable head: 9bb8753acdd8c679c474b3531e026dd389a6e46c commit: 5f408bfe0d1375cebe7a5ebfac1182bbcaf8b887 [34/123] mm: gup: stop abusing try_grab_folio config: powerpc64-randconfig-003-20240630 compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a) reproduce (this is a W=1 build): 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 | Closes: https://lore.kernel.org/oe-kbuild-all/202407010039.D3sIu3fu-lkp@intel.com/ All errors (new ones prefixed by >>): >> mm/gup.c:474:11: error: call to undeclared function 'try_grab_folio_fast'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] folio = try_grab_folio_fast(page, refs, flags); ^ mm/gup.c:474:11: note: did you mean 'try_grab_folio'? mm/gup.c:139:18: note: 'try_grab_folio' declared here int __must_check try_grab_folio(struct folio *folio, int refs, ^ mm/gup.c:474:9: error: incompatible integer to pointer conversion assigning to 'struct folio *' from 'int' [-Wint-conversion] folio = try_grab_folio_fast(page, refs, flags); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/gup.c:2747:22: error: static declaration of 'try_grab_folio_fast' follows non-static declaration static struct folio *try_grab_folio_fast(struct page *page, int refs, ^ mm/gup.c:474:11: note: previous implicit declaration is here folio = try_grab_folio_fast(page, refs, flags); ^ 3 errors generated. vim +/try_grab_folio_fast +474 mm/gup.c 439 440 /* 441 * Returns 1 if succeeded, 0 if failed, -EMLINK if unshare needed. 442 * 443 * NOTE: for the same entry, gup-fast and gup-slow can return different 444 * results (0 v.s. -EMLINK) depending on whether vma is available. This is 445 * the expected behavior, where we simply want gup-fast to fallback to 446 * gup-slow to take the vma reference first. 447 */ 448 static int gup_hugepte(struct vm_area_struct *vma, pte_t *ptep, unsigned long sz, 449 unsigned long addr, unsigned long end, unsigned int flags, 450 struct page **pages, int *nr, bool fast) 451 { 452 unsigned long pte_end; 453 struct page *page; 454 struct folio *folio; 455 pte_t pte; 456 int refs; 457 458 pte_end = (addr + sz) & ~(sz-1); 459 if (pte_end < end) 460 end = pte_end; 461 462 pte = huge_ptep_get(ptep); 463 464 if (!pte_access_permitted(pte, flags & FOLL_WRITE)) 465 return 0; 466 467 /* hugepages are never "special" */ 468 VM_BUG_ON(!pfn_valid(pte_pfn(pte))); 469 470 page = pte_page(pte); 471 refs = record_subpages(page, sz, addr, end, pages + *nr); 472 473 if (fast) { > 474 folio = try_grab_folio_fast(page, refs, flags); 475 if (!folio) 476 return 0; 477 } else { 478 folio = page_folio(page); 479 if (try_grab_folio(folio, refs, flags)) 480 return 0; 481 } 482 483 if (unlikely(pte_val(pte) != pte_val(ptep_get(ptep)))) { 484 gup_put_folio(folio, refs, flags); 485 return 0; 486 } 487 488 if (!pte_write(pte) && gup_must_unshare(vma, flags, &folio->page)) { 489 gup_put_folio(folio, refs, flags); 490 return -EMLINK; 491 } 492 493 *nr += refs; 494 folio_set_referenced(folio); 495 return 1; 496 } 497 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki