Re: [PATCH] mm/rmap: use huge_ptep_get() in try_to_unmap_one()

From: David Hildenbrand (Arm)

Date: Thu Jun 25 2026 - 03:56:16 EST


On 6/25/26 08:59, Dev Jain wrote:
>
>
> On 25/06/26 11:15 am, kernel test robot wrote:
>> Hi Dev,
>>
>> kernel test robot noticed the following build errors:
>>
>> [auto build test ERROR on akpm-mm/mm-everything]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Dev-Jain/mm-rmap-use-huge_ptep_get-in-try_to_unmap_one/20260625-123050
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
>> patch link: https://lore.kernel.org/r/20260625042853.2752898-1-dev.jain%40arm.com
>> patch subject: [PATCH] mm/rmap: use huge_ptep_get() in try_to_unmap_one()
>> config: hexagon-allnoconfig (https://download.01.org/0day-ci/archive/20260625/202606251341.jfIr1D7m-lkp@xxxxxxxxx/config)
>> compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 6cc609bb250b21b47fc7d394b4019101e9983597)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260625/202606251341.jfIr1D7m-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/202606251341.jfIr1D7m-lkp@xxxxxxxxx/
>>
>> All errors (new ones prefixed by >>):
>>
>> 2100 | pteval = huge_ptep_get(mm, address, pvmw.pte);
>> | ^
>> 2100 | pteval = huge_ptep_get(mm, address, pvmw.pte);
>> | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 2 errors generated.
>
> Weird that I need a stub. This should do:
>
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 2abaf99321e90..4661f88eee55b 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -1261,6 +1261,16 @@ static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
> {
> }
>
> +static inline pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr,
> + pte_t *ptep)
> +{
> +#ifdef CONFIG_MMU
> + return ptep_get(ptep);
> +#else
> + return *ptep;
> +#endif

Without CONFIG_HUGETLB_PAGE, folio_test_hugetlb() == false and the compiler will
never end up actually linking this function.

So probably you can just let the linker deal with that

pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep);


If abused, the linker would complain. In you case, the compiler will optimize it
out (and be happy) and the linker will never start looking for the symbol (that
doesn't exist).

--
Cheers,

David