mm/bpf_memcontrol.c:125:27: sparse: sparse: symbol 'bpf_mem_cgroup_memory_events' was not declared. Should it be static?
From: kernel test robot
Date: Wed Sep 23 2026 - 22:33:48 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fe2ec83746e501645709761605c2464a44fd2929
commit: 99430ab8b804c26b8a0dec93fcbfe75469f3edc7 mm: introduce BPF kfuncs to access memcg statistics and events
date: 9 months ago
config: sparc-randconfig-r1307-20260924 (https://download.01.org/0day-ci/archive/20260924/202609241059.dkB8hWSY-lkp@xxxxxxxxx/config)
compiler: sparc-linux-gcc (GCC) 16.1.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260924/202609241059.dkB8hWSY-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
| Fixes: 99430ab8b804 ("mm: introduce BPF kfuncs to access memcg statistics and events")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609241059.dkB8hWSY-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> mm/bpf_memcontrol.c:125:27: sparse: sparse: symbol 'bpf_mem_cgroup_memory_events' was not declared. Should it be static?
mm/bpf_memcontrol.c:68:9: sparse: sparse: context imbalance in 'bpf_get_mem_cgroup' - different lock contexts for basic block
vim +/bpf_mem_cgroup_memory_events +125 mm/bpf_memcontrol.c
117
118 /**
119 * bpf_mem_cgroup_memory_events - Read memory cgroup's memory event value
120 * @memcg: memory cgroup
121 * @event: memory event id
122 *
123 * Return: The current value of the memory event counter.
124 */
> 125 __bpf_kfunc unsigned long bpf_mem_cgroup_memory_events(struct mem_cgroup *memcg,
126 enum memcg_memory_event event)
127 {
128 if (unlikely(event >= MEMCG_NR_MEMORY_EVENTS))
129 return (unsigned long)-1;
130
131 return atomic_long_read(&memcg->memory_events[event]);
132 }
133
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki