tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 1eb586a9782cde8e5091b9de74603e0a8386b09e commit: ee3fe497bdf0c7cb6fbec346f36aa1f9b1dfe6dd [9137/9689] mm: gup: do not call try_grab_folio() in slow path config: powerpc64-randconfig-003-20240629 compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 326ba38a991250a8587a399a260b0f7af2c9166a) 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/202406291219.fqTR9WPY-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from mm/gup.c:7: In file included from include/linux/mm.h:2258: include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 500 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 501 | item]; | ~~~~ include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 507 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 508 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 519 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 520 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 528 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 529 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ In file included from mm/gup.c:19: include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 47 | __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages); | ~~~~~~~~~~~ ^ ~~~ include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 49 | NR_ZONE_LRU_BASE + lru, nr_pages); | ~~~~~~~~~~~~~~~~ ^ ~~~ >> mm/gup.c:476:11: error: call to undeclared function 'try_grab_folio_fast'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 476 | folio = try_grab_folio_fast(page, refs, flags); | ^ mm/gup.c:476:11: note: did you mean 'try_grab_folio'? mm/gup.c:139:18: note: 'try_grab_folio' declared here 139 | int __must_check try_grab_folio(struct folio *folio, int refs, unsigned int flags) | ^ >> mm/gup.c:476:9: error: incompatible integer to pointer conversion assigning to 'struct folio *' from 'int' [-Wint-conversion] 476 | folio = try_grab_folio_fast(page, refs, flags); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> mm/gup.c:2748:22: error: static declaration of 'try_grab_folio_fast' follows non-static declaration 2748 | static struct folio *try_grab_folio_fast(struct page *page, int refs, | ^ mm/gup.c:476:11: note: previous implicit declaration is here 476 | folio = try_grab_folio_fast(page, refs, flags); | ^ 7 warnings and 3 errors generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for HOTPLUG_CPU Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n]) Selected by [y]: - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=n] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y] vim +/try_grab_folio_fast +476 mm/gup.c 441 442 /* 443 * Returns 1 if succeeded, 0 if failed, -EMLINK if unshare needed. 444 * 445 * NOTE: for the same entry, gup-fast and gup-slow can return different 446 * results (0 v.s. -EMLINK) depending on whether vma is available. This is 447 * the expected behavior, where we simply want gup-fast to fallback to 448 * gup-slow to take the vma reference first. 449 */ 450 static int gup_hugepte(struct vm_area_struct *vma, pte_t *ptep, unsigned long sz, 451 unsigned long addr, unsigned long end, unsigned int flags, 452 struct page **pages, int *nr, bool fast) 453 { 454 unsigned long pte_end; 455 struct page *page; 456 struct folio *folio; 457 pte_t pte; 458 int refs; 459 460 pte_end = (addr + sz) & ~(sz-1); 461 if (pte_end < end) 462 end = pte_end; 463 464 pte = huge_ptep_get(ptep); 465 466 if (!pte_access_permitted(pte, flags & FOLL_WRITE)) 467 return 0; 468 469 /* hugepages are never "special" */ 470 VM_BUG_ON(!pfn_valid(pte_pfn(pte))); 471 472 page = pte_page(pte); 473 refs = record_subpages(page, sz, addr, end, pages + *nr); 474 475 if (fast) { > 476 folio = try_grab_folio_fast(page, refs, flags); 477 if (!folio) 478 return 0; 479 } else { 480 folio = page_folio(page); 481 if (try_grab_folio(folio, refs, flags)) 482 return 0; 483 } 484 485 if (unlikely(pte_val(pte) != pte_val(ptep_get(ptep)))) { 486 gup_put_folio(folio, refs, flags); 487 return 0; 488 } 489 490 if (!pte_write(pte) && gup_must_unshare(vma, flags, &folio->page)) { 491 gup_put_folio(folio, refs, flags); 492 return -EMLINK; 493 } 494 495 *nr += refs; 496 folio_set_referenced(folio); 497 return 1; 498 } 499 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki