Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed
       [not found] <20241014203646.1952505-4-surenb@google.com>
@ 2024-10-18 12:01 ` kernel test robot
  2024-10-18 15:45   ` Suren Baghdasaryan
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-10-18 12:01 UTC (permalink / raw)
  To: Suren Baghdasaryan, akpm
  Cc: llvm, oe-kbuild-all, kent.overstreet, corbet, arnd, mcgrof, rppt,
	paulmck, thuth, tglx, bp, xiongwei.song, ardb, david, vbabka,
	mhocko, hannes, roman.gushchin, dave, willy, liam.howlett,
	pasha.tatashin, souravpanda, keescook, dennis, jhubbard, yuzhao,
	vvvvvv, rostedt, iamjoonsoo.kim, rientjes

Hi Suren,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 828d7267c42c2aab3877c08b4bb00b1e56769557]

url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/maple_tree-add-mas_for_each_rev-helper/20241015-044156
base:   828d7267c42c2aab3877c08b4bb00b1e56769557
patch link:    https://lore.kernel.org/r/20241014203646.1952505-4-surenb%40google.com
patch subject: [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed
config: i386-randconfig-006-20241018 (https://download.01.org/0day-ci/archive/20241018/202410181939.vLqV33c7-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241018/202410181939.vLqV33c7-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/202410181939.vLqV33c7-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/alloc_tag.c:394:4: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
     393 |                 pr_err("Failed to map %lu bytes for module allocation tags\n",
         |                                       ~~~
         |                                       %u
     394 |                         MODULE_ALLOC_TAG_VMAP_SIZE);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   lib/alloc_tag.c:386:36: note: expanded from macro 'MODULE_ALLOC_TAG_VMAP_SIZE'
     386 | #define MODULE_ALLOC_TAG_VMAP_SIZE (100000 * sizeof(struct alloc_tag))
         |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +394 lib/alloc_tag.c

5b662b363f38b01 Suren Baghdasaryan 2024-10-14  387  
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  388  static int __init alloc_mod_tags_mem(void)
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  389  {
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  390  	/* Map space to copy allocation tags */
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  391  	vm_module_tags = execmem_vmap(EXECMEM_MODULE_DATA, MODULE_ALLOC_TAG_VMAP_SIZE);
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  392  	if (!vm_module_tags) {
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  393  		pr_err("Failed to map %lu bytes for module allocation tags\n",
5b662b363f38b01 Suren Baghdasaryan 2024-10-14 @394  			MODULE_ALLOC_TAG_VMAP_SIZE);
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  395  		module_tags.start_addr = 0;
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  396  		return -ENOMEM;
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  397  	}
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  398  
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  399  	vm_module_tags->pages = kmalloc_array(get_vm_area_size(vm_module_tags) >> PAGE_SHIFT,
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  400  					sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  401  	if (!vm_module_tags->pages) {
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  402  		free_vm_area(vm_module_tags);
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  403  		return -ENOMEM;
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  404  	}
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  405  
f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  406  	module_tags.start_addr = (unsigned long)vm_module_tags->addr;
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  407  	module_tags.end_addr = module_tags.start_addr + MODULE_ALLOC_TAG_VMAP_SIZE;
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  408  
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  409  	return 0;
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  410  }
5b662b363f38b01 Suren Baghdasaryan 2024-10-14  411  

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed
  2024-10-18 12:01 ` [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed kernel test robot
@ 2024-10-18 15:45   ` Suren Baghdasaryan
  0 siblings, 0 replies; 2+ messages in thread
From: Suren Baghdasaryan @ 2024-10-18 15:45 UTC (permalink / raw)
  To: kernel test robot
  Cc: akpm, llvm, oe-kbuild-all, kent.overstreet, corbet, arnd, mcgrof,
	rppt, paulmck, thuth, tglx, bp, xiongwei.song, ardb, david,
	vbabka, mhocko, hannes, roman.gushchin, dave, willy, liam.howlett,
	pasha.tatashin, souravpanda, keescook, dennis, jhubbard, yuzhao,
	vvvvvv, rostedt, iamjoonsoo.kim, rientjes

On Fri, Oct 18, 2024 at 5:01 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Suren,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on 828d7267c42c2aab3877c08b4bb00b1e56769557]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/maple_tree-add-mas_for_each_rev-helper/20241015-044156
> base:   828d7267c42c2aab3877c08b4bb00b1e56769557
> patch link:    https://lore.kernel.org/r/20241014203646.1952505-4-surenb%40google.com
> patch subject: [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed
> config: i386-randconfig-006-20241018 (https://download.01.org/0day-ci/archive/20241018/202410181939.vLqV33c7-lkp@intel.com/config)
> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241018/202410181939.vLqV33c7-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/202410181939.vLqV33c7-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> lib/alloc_tag.c:394:4: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
>      393 |                 pr_err("Failed to map %lu bytes for module allocation tags\n",
>          |                                       ~~~
>          |                                       %u
>      394 |                         MODULE_ALLOC_TAG_VMAP_SIZE);
>          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~

I'll fix this warning in the next version. Thanks!

>    include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
>      533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
>          |                                ~~~     ^~~~~~~~~~~
>    include/linux/printk.h:490:60: note: expanded from macro 'printk'
>      490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
>          |                                                     ~~~    ^~~~~~~~~~~
>    include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
>      462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
>          |                         ~~~~    ^~~~~~~~~~~
>    lib/alloc_tag.c:386:36: note: expanded from macro 'MODULE_ALLOC_TAG_VMAP_SIZE'
>      386 | #define MODULE_ALLOC_TAG_VMAP_SIZE (100000 * sizeof(struct alloc_tag))
>          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
>
>
> vim +394 lib/alloc_tag.c
>
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  387
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  388  static int __init alloc_mod_tags_mem(void)
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  389  {
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  390      /* Map space to copy allocation tags */
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  391      vm_module_tags = execmem_vmap(EXECMEM_MODULE_DATA, MODULE_ALLOC_TAG_VMAP_SIZE);
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  392      if (!vm_module_tags) {
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  393              pr_err("Failed to map %lu bytes for module allocation tags\n",
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14 @394                      MODULE_ALLOC_TAG_VMAP_SIZE);
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  395              module_tags.start_addr = 0;
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  396              return -ENOMEM;
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  397      }
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  398
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  399      vm_module_tags->pages = kmalloc_array(get_vm_area_size(vm_module_tags) >> PAGE_SHIFT,
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  400                                      sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  401      if (!vm_module_tags->pages) {
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  402              free_vm_area(vm_module_tags);
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  403              return -ENOMEM;
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  404      }
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  405
> f0d7ffe60ce5cf0 Suren Baghdasaryan 2024-10-14  406      module_tags.start_addr = (unsigned long)vm_module_tags->addr;
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  407      module_tags.end_addr = module_tags.start_addr + MODULE_ALLOC_TAG_VMAP_SIZE;
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  408
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  409      return 0;
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  410  }
> 5b662b363f38b01 Suren Baghdasaryan 2024-10-14  411
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-18 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241014203646.1952505-4-surenb@google.com>
2024-10-18 12:01 ` [PATCH v3 3/5] alloc_tag: populate memory for module tags as needed kernel test robot
2024-10-18 15:45   ` Suren Baghdasaryan

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