linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [akpm-mm:mm-unstable 31/159] lib/alloc_tag.c:641:17: error: implicit declaration of function 'kmemleak_igonore_percpu'; did you mean 'kmemleak_ignore_phys'?
@ 2025-06-20  7:53 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-20  7:53 UTC (permalink / raw)
  To: Hao Ge; +Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   2cdf4156ee65d8b988f460ee2c8802ea7c455fa7
commit: 5b70675cebc3dfcdb355054122698de788cb052d [31/159] mm/alloc_tag: fix the kmemleak false positive issue in the allocation of the percpu variable tag->counters
config: csky-randconfig-001-20250620 (https://download.01.org/0day-ci/archive/20250620/202506201556.3CQsVRca-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250620/202506201556.3CQsVRca-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/202506201556.3CQsVRca-lkp@intel.com/

All errors (new ones prefixed by >>):

   lib/alloc_tag.c: In function 'load_module':
>> lib/alloc_tag.c:641:17: error: implicit declaration of function 'kmemleak_igonore_percpu'; did you mean 'kmemleak_ignore_phys'? [-Werror=implicit-function-declaration]
     641 |                 kmemleak_igonore_percpu(tag->counters);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
         |                 kmemleak_ignore_phys
   cc1: some warnings being treated as errors


vim +641 lib/alloc_tag.c

   610	
   611	static int load_module(struct module *mod, struct codetag *start, struct codetag *stop)
   612	{
   613		/* Allocate module alloc_tag percpu counters */
   614		struct alloc_tag *start_tag;
   615		struct alloc_tag *stop_tag;
   616		struct alloc_tag *tag;
   617	
   618		/* percpu counters for core allocations are already statically allocated */
   619		if (!mod)
   620			return 0;
   621	
   622		start_tag = ct_to_alloc_tag(start);
   623		stop_tag = ct_to_alloc_tag(stop);
   624		for (tag = start_tag; tag < stop_tag; tag++) {
   625			WARN_ON(tag->counters);
   626			tag->counters = alloc_percpu(struct alloc_tag_counters);
   627			if (!tag->counters) {
   628				while (--tag >= start_tag) {
   629					free_percpu(tag->counters);
   630					tag->counters = NULL;
   631				}
   632				pr_err("Failed to allocate memory for allocation tag percpu counters in the module %s\n",
   633				       mod->name);
   634				return -ENOMEM;
   635			}
   636	
   637			/*
   638			 * Avoid a kmemleak false positive. The pointer to the counters is stored
   639			 * in the alloc_tag section of the module and cannot be directly accessed.
   640			 */
 > 641			kmemleak_igonore_percpu(tag->counters);
   642		}
   643		return 0;
   644	}
   645	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-20  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20  7:53 [akpm-mm:mm-unstable 31/159] lib/alloc_tag.c:641:17: error: implicit declaration of function 'kmemleak_igonore_percpu'; did you mean 'kmemleak_ignore_phys'? kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox