Re: [PATCH v2] mm/mempolicy: track page allocations per mempolicy
From: kernel test robot
Date: Sat Mar 07 2026 - 14:58:18 EST
Hi JP,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/JP-Kobryn-Meta/mm-mempolicy-track-page-allocations-per-mempolicy/20260307-125642
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20260307045520.247998-1-jp.kobryn%40linux.dev
patch subject: [PATCH v2] mm/mempolicy: track page allocations per mempolicy
config: arm64-randconfig-001-20260307 (https://download.01.org/0day-ci/archive/20260308/202603080349.ya7tIjgk-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260308/202603080349.ya7tIjgk-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603080349.ya7tIjgk-lkp@xxxxxxxxx/
All error/warnings (new ones prefixed by >>):
mm/mempolicy.c: In function 'mpol_count_numa_alloc':
>> mm/mempolicy.c:2489:10: error: implicit declaration of function 'mem_cgroup_from_task'; did you mean 'perf_cgroup_from_task'? [-Werror=implicit-function-declaration]
memcg = mem_cgroup_from_task(current);
^~~~~~~~~~~~~~~~~~~~
perf_cgroup_from_task
>> mm/mempolicy.c:2489:8: warning: assignment to 'struct mem_cgroup *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
memcg = mem_cgroup_from_task(current);
^
cc1: some warnings being treated as errors
vim +2489 mm/mempolicy.c
2429
2430 /*
2431 * Count a mempolicy allocation. Stats are tracked per-node and per-cgroup.
2432 * The following numa_{hit/miss/foreign} pattern is used:
2433 *
2434 * hit
2435 * - for BIND and PREFERRED_MANY, allocation succeeded on node in nodemask
2436 * - for other policies, allocation succeeded on intended node
2437 * - counted on the node of the allocation
2438 * miss
2439 * - allocation intended for other node, but happened on this one
2440 * - counted on other node
2441 * foreign
2442 * - allocation intended on this node, but happened on other node
2443 * - counted on this node
2444 */
2445 static void mpol_count_numa_alloc(struct mempolicy *pol, int intended_nid,
2446 struct page *page, unsigned int order)
2447 {
2448 int actual_nid = page_to_nid(page);
2449 long nr_pages = 1L << order;
2450 enum node_stat_item hit_idx;
2451 struct mem_cgroup *memcg;
2452 struct lruvec *lruvec;
2453 bool is_hit;
2454
2455 if (!root_mem_cgroup || mem_cgroup_disabled())
2456 return;
2457
2458 /*
2459 * Start with hit then use +1 or +2 later on to change to miss or
2460 * foreign respectively if needed.
2461 */
2462 switch (pol->mode) {
2463 case MPOL_PREFERRED:
2464 hit_idx = NUMA_MPOL_PREFERRED_HIT;
2465 break;
2466 case MPOL_PREFERRED_MANY:
2467 hit_idx = NUMA_MPOL_PREFERRED_MANY_HIT;
2468 break;
2469 case MPOL_BIND:
2470 hit_idx = NUMA_MPOL_BIND_HIT;
2471 break;
2472 case MPOL_INTERLEAVE:
2473 hit_idx = NUMA_MPOL_INTERLEAVE_HIT;
2474 break;
2475 case MPOL_WEIGHTED_INTERLEAVE:
2476 hit_idx = NUMA_MPOL_WEIGHTED_INTERLEAVE_HIT;
2477 break;
2478 default:
2479 hit_idx = NUMA_MPOL_LOCAL_HIT;
2480 break;
2481 }
2482
2483 if (pol->mode == MPOL_BIND || pol->mode == MPOL_PREFERRED_MANY)
2484 is_hit = node_isset(actual_nid, pol->nodes);
2485 else
2486 is_hit = (actual_nid == intended_nid);
2487
2488 rcu_read_lock();
> 2489 memcg = mem_cgroup_from_task(current);
2490
2491 if (is_hit) {
2492 lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(actual_nid));
2493 mod_lruvec_state(lruvec, hit_idx, nr_pages);
2494 } else {
2495 /* account for miss on the fallback node */
2496 lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(actual_nid));
2497 mod_lruvec_state(lruvec, hit_idx + 1, nr_pages);
2498
2499 /* account for foreign on the intended node */
2500 lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(intended_nid));
2501 mod_lruvec_state(lruvec, hit_idx + 2, nr_pages);
2502 }
2503
2504 rcu_read_unlock();
2505 }
2506
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki