From: kernel test robot <lkp@intel.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
mm-commits@vger.kernel.org,
"Lorenzo Stoakes (Oracle)" <ljs@kernel.org>
Subject: [akpm-mm:mm-new 429/433] mm/swap_state.c:468:19: error: call to undeclared function 'folio_memcg_alloc_deferred'; ISO C99 and later do not support implicit function declarations
Date: Thu, 28 May 2026 16:15:31 +0800 [thread overview]
Message-ID: <202605281620.lc3rtkBm-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
head: d7d405cc33d6e3eeba2d6ec8f0b595da2a5c600a
commit: a5e62d9e00dac6f96174c397a82da30e7ae53064 [429/433] mm: switch deferred split shrinker to list_lru
config: hexagon-defconfig (https://download.01.org/0day-ci/archive/20260528/202605281620.lc3rtkBm-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9409c07de6378507397ecdb6f05f628f58110112)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260528/202605281620.lc3rtkBm-lkp@intel.com/reproduce)
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/202605281620.lc3rtkBm-lkp@intel.com/
All errors (new ones prefixed by >>):
>> mm/swap_state.c:468:19: error: call to undeclared function 'folio_memcg_alloc_deferred'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
468 | if (order > 1 && folio_memcg_alloc_deferred(folio)) {
| ^
1 error generated.
vim +/folio_memcg_alloc_deferred +468 mm/swap_state.c
390
391 /*
392 * Try to allocate a folio of given order in the swap cache.
393 *
394 * This helper resolves the potential races of swap allocation
395 * and prepares a folio to be used for swap IO. May return following
396 * value:
397 *
398 * -ENOMEM / -EBUSY: Order is too large or in conflict with sub slot,
399 * caller should shrink the order and retry
400 * -ENOENT / -EEXIST: Target swap entry is unavailable or cached, the caller
401 * should abort or try to use the cached folio instead
402 */
403 static struct folio *__swap_cache_alloc(struct swap_cluster_info *ci,
404 swp_entry_t targ_entry, gfp_t gfp,
405 unsigned int order, struct vm_fault *vmf,
406 struct mempolicy *mpol, pgoff_t ilx)
407 {
408 int err;
409 swp_entry_t entry;
410 struct folio *folio;
411 void *shadow = NULL;
412 unsigned short memcg_id;
413 unsigned long address, nr_pages = 1UL << order;
414 struct vm_area_struct *vma = vmf ? vmf->vma : NULL;
415
416 VM_WARN_ON_ONCE(nr_pages > SWAPFILE_CLUSTER);
417 entry.val = round_down(targ_entry.val, nr_pages);
418
419 /* Check if the slot and range are available, skip allocation if not */
420 spin_lock(&ci->lock);
421 err = __swap_cache_add_check(ci, targ_entry, nr_pages, NULL, NULL);
422 spin_unlock(&ci->lock);
423 if (unlikely(err))
424 return ERR_PTR(err);
425
426 /*
427 * Limit THP gfp. The limitation is a no-op for typical
428 * GFP_HIGHUSER_MOVABLE but matters for shmem.
429 */
430 if (order)
431 gfp = thp_shmem_limit_gfp_mask(vma_thp_gfp_mask(vma), gfp);
432
433 if (mpol || !vmf) {
434 folio = folio_alloc_mpol(gfp, order, mpol, ilx, numa_node_id());
435 } else {
436 address = round_down(vmf->address, PAGE_SIZE << order);
437 folio = vma_alloc_folio(gfp, order, vmf->vma, address);
438 }
439 if (unlikely(!folio))
440 return ERR_PTR(-ENOMEM);
441
442 /* Double check the range is still not in conflict */
443 spin_lock(&ci->lock);
444 err = __swap_cache_add_check(ci, targ_entry, nr_pages, &shadow, &memcg_id);
445 if (unlikely(err)) {
446 spin_unlock(&ci->lock);
447 folio_put(folio);
448 return ERR_PTR(err);
449 }
450
451 __folio_set_locked(folio);
452 __folio_set_swapbacked(folio);
453 __swap_cache_do_add_folio(ci, folio, entry);
454 spin_unlock(&ci->lock);
455
456 if (mem_cgroup_swapin_charge_folio(folio, memcg_id,
457 vmf ? vmf->vma->vm_mm : NULL, gfp)) {
458 spin_lock(&ci->lock);
459 __swap_cache_do_del_folio(ci, folio, entry, shadow);
460 spin_unlock(&ci->lock);
461 folio_unlock(folio);
462 /* nr_pages refs from swap cache, 1 from allocation */
463 folio_put_refs(folio, nr_pages + 1);
464 count_mthp_stat(order, MTHP_STAT_SWPIN_FALLBACK_CHARGE);
465 return ERR_PTR(-ENOMEM);
466 }
467
> 468 if (order > 1 && folio_memcg_alloc_deferred(folio)) {
469 spin_lock(&ci->lock);
470 __swap_cache_do_del_folio(ci, folio, entry, shadow);
471 spin_unlock(&ci->lock);
472 folio_unlock(folio);
473 /* nr_pages refs from swap cache, 1 from allocation */
474 folio_put_refs(folio, nr_pages + 1);
475 return ERR_PTR(-ENOMEM);
476 }
477
478 /* memsw uncharges swap when folio is added to swap cache */
479 memcg1_swapin(folio);
480 if (shadow)
481 workingset_refault(folio, shadow);
482
483 node_stat_mod_folio(folio, NR_FILE_PAGES, nr_pages);
484 lruvec_stat_mod_folio(folio, NR_SWAPCACHE, nr_pages);
485
486 /* Caller will initiate read into locked new_folio */
487 folio_add_lru(folio);
488 return folio;
489 }
490
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-28 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 8:15 kernel test robot [this message]
2026-05-28 22:16 ` [akpm-mm:mm-new 429/433] mm/swap_state.c:468:19: error: call to undeclared function 'folio_memcg_alloc_deferred'; ISO C99 and later do not support implicit function declarations Andrew Morton
2026-05-29 12:35 ` Johannes Weiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605281620.lc3rtkBm-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mm-commits@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox