Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE
       [not found] <Z1Ce6j5WiBE3kaGf@bender.morinfr.org>
@ 2024-12-05  1:23 ` kernel test robot
  2024-12-05  2:05 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-05  1:23 UTC (permalink / raw)
  To: Guillaume Morin, linux-kernel
  Cc: llvm, oe-kbuild-all, linux-mm, guillaume, Muchun Song,
	Andrew Morton, Peter Xu, David Hildenbrand, Eric Hagberg

Hi Guillaume,

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.13-rc1 next-20241204]
[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/Guillaume-Morin/hugetlb-support-FOLL_FORCE-FOLL_WRITE/20241205-022843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/Z1Ce6j5WiBE3kaGf%40bender.morinfr.org
patch subject: [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE
config: x86_64-buildonly-randconfig-002-20241205 (https://download.01.org/0day-ci/archive/20241205/202412050954.m9cwNOJC-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241205/202412050954.m9cwNOJC-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/202412050954.m9cwNOJC-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from mm/gup.c:7:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from mm/gup.c:20:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
>> mm/gup.c:681:33: warning: variable 'page' is uninitialized when used here [-Wuninitialized]
     681 |             !can_follow_write_pud(pud, page, vma, flags))
         |                                        ^~~~
   mm/gup.c:673:19: note: initialize the variable 'page' to silence this warning
     673 |         struct page *page;
         |                          ^
         |                           = NULL
   7 warnings generated.


vim +/page +681 mm/gup.c

   667	
   668	static struct page *follow_huge_pud(struct vm_area_struct *vma,
   669					    unsigned long addr, pud_t *pudp,
   670					    int flags, struct follow_page_context *ctx)
   671	{
   672		struct mm_struct *mm = vma->vm_mm;
   673		struct page *page;
   674		pud_t pud = *pudp;
   675		unsigned long pfn = pud_pfn(pud);
   676		int ret;
   677	
   678		assert_spin_locked(pud_lockptr(mm, pudp));
   679	
   680		if ((flags & FOLL_WRITE) &&
 > 681		    !can_follow_write_pud(pud, page, vma, flags))
   682			return NULL;
   683	
   684		if (!pud_present(pud))
   685			return NULL;
   686	
   687		pfn += (addr & ~PUD_MASK) >> PAGE_SHIFT;
   688	
   689		if (IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) &&
   690		    pud_devmap(pud)) {
   691			/*
   692			 * device mapped pages can only be returned if the caller
   693			 * will manage the page reference count.
   694			 *
   695			 * At least one of FOLL_GET | FOLL_PIN must be set, so
   696			 * assert that here:
   697			 */
   698			if (!(flags & (FOLL_GET | FOLL_PIN)))
   699				return ERR_PTR(-EEXIST);
   700	
   701			if (flags & FOLL_TOUCH)
   702				touch_pud(vma, addr, pudp, flags & FOLL_WRITE);
   703	
   704			ctx->pgmap = get_dev_pagemap(pfn, ctx->pgmap);
   705			if (!ctx->pgmap)
   706				return ERR_PTR(-EFAULT);
   707		}
   708	
   709		page = pfn_to_page(pfn);
   710	
   711		if (!pud_devmap(pud) && !pud_write(pud) &&
   712		    gup_must_unshare(vma, flags, page))
   713			return ERR_PTR(-EMLINK);
   714	
   715		ret = try_grab_folio(page_folio(page), 1, flags);
   716		if (ret)
   717			page = ERR_PTR(ret);
   718		else
   719			ctx->page_mask = HPAGE_PUD_NR - 1;
   720	
   721		return page;
   722	}
   723	

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

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

* Re: [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE
       [not found] <Z1Ce6j5WiBE3kaGf@bender.morinfr.org>
  2024-12-05  1:23 ` [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE kernel test robot
@ 2024-12-05  2:05 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-05  2:05 UTC (permalink / raw)
  To: Guillaume Morin, linux-kernel
  Cc: llvm, oe-kbuild-all, linux-mm, guillaume, Muchun Song,
	Andrew Morton, Peter Xu, David Hildenbrand, Eric Hagberg

Hi Guillaume,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.13-rc1 next-20241204]
[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/Guillaume-Morin/hugetlb-support-FOLL_FORCE-FOLL_WRITE/20241205-022843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/Z1Ce6j5WiBE3kaGf%40bender.morinfr.org
patch subject: [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE
config: i386-buildonly-randconfig-002 (https://download.01.org/0day-ci/archive/20241205/202412050943.6b8BLXfY-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241205/202412050943.6b8BLXfY-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/202412050943.6b8BLXfY-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/gup.c:7:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from mm/gup.c:20:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
>> mm/gup.c:665:41: error: call to undeclared function 'pud_soft_dirty'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     665 |         return !vma_soft_dirty_enabled(vma) || pud_soft_dirty(pud);
         |                                                ^
   mm/gup.c:665:41: note: did you mean 'pmd_soft_dirty'?
   include/linux/pgtable.h:1427:19: note: 'pmd_soft_dirty' declared here
    1427 | static inline int pmd_soft_dirty(pmd_t pmd)
         |                   ^
   3 warnings and 1 error generated.


vim +/pud_soft_dirty +665 mm/gup.c

   650	
   651	#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES
   652	/* FOLL_FORCE can write to even unwritable PUDs in COW mappings. */
   653	static inline bool can_follow_write_pud(pud_t pud, struct page *page,
   654						struct vm_area_struct *vma,
   655						unsigned int flags)
   656	{
   657		/* If the pud is writable, we can write to the page. */
   658		if (pud_write(pud))
   659			return true;
   660	
   661		if (!can_follow_write_common(page, vma, flags))
   662			return false;
   663	
   664		/* ... and a write-fault isn't required for other reasons. */
 > 665		return !vma_soft_dirty_enabled(vma) || pud_soft_dirty(pud);
   666	}
   667	

-- 
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-12-05  2:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Z1Ce6j5WiBE3kaGf@bender.morinfr.org>
2024-12-05  1:23 ` [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE kernel test robot
2024-12-05  2:05 ` 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