tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y head: 8c05f5e0777d154e70c3ab34e0fb0e1778b7e23c commit: afc18d881ead528b9842041c60a8e24d3d19ed10 [6427/6462] mm/hugetlb: fix races when looking up a CONT-PTE/PMD size hugetlb page config: i386-randconfig-a013-20221212 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=afc18d881ead528b9842041c60a8e24d3d19ed10 git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git git fetch --no-tags linux-stable-rc linux-5.4.y git checkout afc18d881ead528b9842041c60a8e24d3d19ed10 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): mm/hugetlb.c: In function 'follow_huge_pmd_pte': >> mm/hugetlb.c:5191:1: warning: label 'out' defined but not used [-Wunused-label] 5191 | out: | ^~~ vim +/out +5191 mm/hugetlb.c 4dc71451a2078e Aneesh Kumar K.V 2017-07-06 5158 61f77eda9bbf0d Naoya Horiguchi 2015-02-11 5159 struct page * __weak afc18d881ead52 Baolin Wang 2022-09-01 5160 follow_huge_pmd_pte(struct vm_area_struct *vma, unsigned long address, int flags) 9e5fc74c302505 Steve Capper 2013-04-30 5161 { afc18d881ead52 Baolin Wang 2022-09-01 5162 struct hstate *h = hstate_vma(vma); afc18d881ead52 Baolin Wang 2022-09-01 5163 struct mm_struct *mm = vma->vm_mm; e66f17ff71772b Naoya Horiguchi 2015-02-11 5164 struct page *page = NULL; e66f17ff71772b Naoya Horiguchi 2015-02-11 5165 spinlock_t *ptl; afc18d881ead52 Baolin Wang 2022-09-01 5166 pte_t *ptep, pte; afc18d881ead52 Baolin Wang 2022-09-01 5167 e66f17ff71772b Naoya Horiguchi 2015-02-11 5168 retry: afc18d881ead52 Baolin Wang 2022-09-01 5169 ptep = huge_pte_offset(mm, address, huge_page_size(h)); afc18d881ead52 Baolin Wang 2022-09-01 5170 if (!ptep) afc18d881ead52 Baolin Wang 2022-09-01 5171 return NULL; afc18d881ead52 Baolin Wang 2022-09-01 5172 afc18d881ead52 Baolin Wang 2022-09-01 5173 ptl = huge_pte_lock(h, mm, ptep); afc18d881ead52 Baolin Wang 2022-09-01 5174 pte = huge_ptep_get(ptep); c9d398fa237882 Naoya Horiguchi 2017-03-31 5175 if (pte_present(pte)) { afc18d881ead52 Baolin Wang 2022-09-01 5176 page = pte_page(pte) + afc18d881ead52 Baolin Wang 2022-09-01 5177 ((address & ~huge_page_mask(h)) >> PAGE_SHIFT); e66f17ff71772b Naoya Horiguchi 2015-02-11 5178 if (flags & FOLL_GET) e66f17ff71772b Naoya Horiguchi 2015-02-11 5179 get_page(page); e66f17ff71772b Naoya Horiguchi 2015-02-11 5180 } else { c9d398fa237882 Naoya Horiguchi 2017-03-31 5181 if (is_hugetlb_entry_migration(pte)) { e66f17ff71772b Naoya Horiguchi 2015-02-11 5182 spin_unlock(ptl); afc18d881ead52 Baolin Wang 2022-09-01 5183 __migration_entry_wait(mm, ptep, ptl); e66f17ff71772b Naoya Horiguchi 2015-02-11 5184 goto retry; e66f17ff71772b Naoya Horiguchi 2015-02-11 5185 } e66f17ff71772b Naoya Horiguchi 2015-02-11 5186 /* e66f17ff71772b Naoya Horiguchi 2015-02-11 5187 * hwpoisoned entry is treated as no_page_table in e66f17ff71772b Naoya Horiguchi 2015-02-11 5188 * follow_page_mask(). e66f17ff71772b Naoya Horiguchi 2015-02-11 5189 */ e66f17ff71772b Naoya Horiguchi 2015-02-11 5190 } e66f17ff71772b Naoya Horiguchi 2015-02-11 @5191 out: e66f17ff71772b Naoya Horiguchi 2015-02-11 5192 spin_unlock(ptl); 9e5fc74c302505 Steve Capper 2013-04-30 5193 return page; 9e5fc74c302505 Steve Capper 2013-04-30 5194 } 9e5fc74c302505 Steve Capper 2013-04-30 5195 :::::: The code at line 5191 was first introduced by commit :::::: e66f17ff71772b209eed39de35aaa99ba819c93d mm/hugetlb: take page table lock in follow_huge_pmd() :::::: TO: Naoya Horiguchi :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://01.org/lkp