Re: [PATCH 7/7] mm/mremap: thread state through move page table operation

From: kernel test robot
Date: Mon Mar 03 2025 - 18:31:04 EST


Hi Lorenzo,

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.14-rc5 next-20250303]
[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/Lorenzo-Stoakes/mm-mremap-correctly-handle-partial-mremap-of-VMA-starting-at-0/20250303-192101
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/4cc18ebfc0cb32e9e42d86503cef3265108343e4.1740911247.git.lorenzo.stoakes%40oracle.com
patch subject: [PATCH 7/7] mm/mremap: thread state through move page table operation
config: x86_64-buildonly-randconfig-005-20250304 (https://download.01.org/0day-ci/archive/20250304/202503040759.5zpJdC2i-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250304/202503040759.5zpJdC2i-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/202503040759.5zpJdC2i-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

mm/mremap.c: In function 'move_pgt_entry':
mm/mremap.c:581:39: error: passing argument 1 of 'move_huge_pud' from incompatible pointer type [-Werror=incompatible-pointer-types]
581 | move_huge_pud(pmc, old_entry, new_entry);
| ^~~
| |
| struct pagetable_move_control *
mm/mremap.c:478:50: note: expected 'struct vm_area_struct *' but argument is of type 'struct pagetable_move_control *'
478 | static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
>> mm/mremap.c:581:44: warning: passing argument 2 of 'move_huge_pud' makes integer from pointer without a cast [-Wint-conversion]
581 | move_huge_pud(pmc, old_entry, new_entry);
| ^~~~~~~~~
| |
| void *
mm/mremap.c:478:69: note: expected 'long unsigned int' but argument is of type 'void *'
478 | static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr,
| ~~~~~~~~~~~~~~^~~~~~~~
mm/mremap.c:581:55: warning: passing argument 3 of 'move_huge_pud' makes integer from pointer without a cast [-Wint-conversion]
581 | move_huge_pud(pmc, old_entry, new_entry);
| ^~~~~~~~~
| |
| void *
mm/mremap.c:479:41: note: expected 'long unsigned int' but argument is of type 'void *'
479 | unsigned long new_addr, pud_t *old_pud, pud_t *new_pud)
| ~~~~~~~~~~~~~~^~~~~~~~
mm/mremap.c:581:25: error: too few arguments to function 'move_huge_pud'
581 | move_huge_pud(pmc, old_entry, new_entry);
| ^~~~~~~~~~~~~
mm/mremap.c:478:13: note: declared here
478 | static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr,
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/move_huge_pud +581 mm/mremap.c

552
553 /*
554 * Attempts to speedup the move by moving entry at the level corresponding to
555 * pgt_entry. Returns true if the move was successful, else false.
556 */
557 static bool move_pgt_entry(struct pagetable_move_control *pmc,
558 enum pgt_entry entry, void *old_entry, void *new_entry)
559 {
560 bool moved = false;
561 bool need_rmap_locks = should_take_rmap_locks(pmc, entry);
562
563 /* See comment in move_ptes() */
564 if (need_rmap_locks)
565 take_rmap_locks(pmc->old);
566
567 switch (entry) {
568 case NORMAL_PMD:
569 moved = move_normal_pmd(pmc, old_entry, new_entry);
570 break;
571 case NORMAL_PUD:
572 moved = move_normal_pud(pmc, old_entry, new_entry);
573 break;
574 case HPAGE_PMD:
575 moved = IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
576 move_huge_pmd(pmc->old, pmc->old_addr, pmc->new_addr, old_entry,
577 new_entry);
578 break;
579 case HPAGE_PUD:
580 moved = IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
> 581 move_huge_pud(pmc, old_entry, new_entry);
582 break;
583
584 default:
585 WARN_ON_ONCE(1);
586 break;
587 }
588
589 if (need_rmap_locks)
590 drop_rmap_locks(pmc->old);
591
592 return moved;
593 }
594

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