Re: [PATCH v2 4/9] mm: vmalloc: Remove global vmap_area_root rb-tree

From: kernel test robot
Date: Tue Aug 29 2023 - 10:32:14 EST


Hi Uladzislau,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/mm-vmalloc-Add-va_alloc-helper/20230829-161248
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20230829081142.3619-5-urezki%40gmail.com
patch subject: [PATCH v2 4/9] mm: vmalloc: Remove global vmap_area_root rb-tree
config: csky-randconfig-r024-20230829 (https://download.01.org/0day-ci/archive/20230829/202308292228.RRrGUYyB-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230829/202308292228.RRrGUYyB-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/202308292228.RRrGUYyB-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

mm/vmalloc.c: In function 'vmap_init_free_space':
>> mm/vmalloc.c:4506:45: warning: ordered comparison of pointer with integer zero [-Wextra]
4506 | if (busy->addr - vmap_start > 0) {
| ^


vim +4506 mm/vmalloc.c

4491
4492 static void vmap_init_free_space(void)
4493 {
4494 unsigned long vmap_start = 1;
4495 const unsigned long vmap_end = ULONG_MAX;
4496 struct vmap_area *free;
4497 struct vm_struct *busy;
4498
4499 /*
4500 * B F B B B F
4501 * -|-----|.....|-----|-----|-----|.....|-
4502 * | The KVA space |
4503 * |<--------------------------------->|
4504 */
4505 for (busy = vmlist; busy; busy = busy->next) {
> 4506 if (busy->addr - vmap_start > 0) {
4507 free = kmem_cache_zalloc(vmap_area_cachep, GFP_NOWAIT);
4508 if (!WARN_ON_ONCE(!free)) {
4509 free->va_start = vmap_start;
4510 free->va_end = (unsigned long) busy->addr;
4511
4512 insert_vmap_area_augment(free, NULL,
4513 &free_vmap_area_root,
4514 &free_vmap_area_list);
4515 }
4516 }
4517
4518 vmap_start = (unsigned long) busy->addr + busy->size;
4519 }
4520
4521 if (vmap_end - vmap_start > 0) {
4522 free = kmem_cache_zalloc(vmap_area_cachep, GFP_NOWAIT);
4523 if (!WARN_ON_ONCE(!free)) {
4524 free->va_start = vmap_start;
4525 free->va_end = vmap_end;
4526
4527 insert_vmap_area_augment(free, NULL,
4528 &free_vmap_area_root,
4529 &free_vmap_area_list);
4530 }
4531 }
4532 }
4533

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