Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v6.1-rc3] [cannot apply to shuah-kselftest/next next-20221103] [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/alexlzhu-fb-com/THP-Shrinker/20221103-140549 patch link: https://lore.kernel.org/r/ddc216d41ff8cf2953488a2e041856c6e8dbd51e.1667454613.git.alexlzhu%40fb.com patch subject: [PATCH v6 3/5] mm: do not remap clean subpages when splitting isolated thp config: i386-randconfig-a004 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/4048042cde24d1c71ae7ce0770af3098195cc45c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review alexlzhu-fb-com/THP-Shrinker/20221103-140549 git checkout 4048042cde24d1c71ae7ce0770af3098195cc45c # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 errors (new ones prefixed by >>): >> mm/migrate.c:206:18: error: use of undeclared identifier 'THP_SPLIT_REMAP_READONLY_ZERO_PAGE' count_vm_event(THP_SPLIT_REMAP_READONLY_ZERO_PAGE); ^ >> mm/migrate.c:211:17: error: use of undeclared identifier 'THP_SPLIT_UNMAP' count_vm_event(THP_SPLIT_UNMAP); ^ 2 errors generated. vim +/THP_SPLIT_REMAP_READONLY_ZERO_PAGE +206 mm/migrate.c 171 172 static bool try_to_unmap_clean(struct page_vma_mapped_walk *pvmw, struct page *page) 173 { 174 void *addr; 175 bool dirty; 176 pte_t newpte; 177 178 VM_BUG_ON_PAGE(PageCompound(page), page); 179 VM_BUG_ON_PAGE(!PageAnon(page), page); 180 VM_BUG_ON_PAGE(!PageLocked(page), page); 181 VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page); 182 183 if (PageMlocked(page) || (pvmw->vma->vm_flags & VM_LOCKED)) 184 return false; 185 186 /* 187 * The pmd entry mapping the old thp was flushed and the pte mapping 188 * this subpage has been non present. Therefore, this subpage is 189 * inaccessible. We don't need to remap it if it contains only zeros. 190 */ 191 addr = kmap_local_page(page); 192 dirty = memchr_inv(addr, 0, PAGE_SIZE); 193 kunmap_local(addr); 194 195 if (dirty) 196 return false; 197 198 pte_clear_not_present_full(pvmw->vma->vm_mm, pvmw->address, pvmw->pte, false); 199 200 if (userfaultfd_armed(pvmw->vma)) { 201 newpte = pte_mkspecial(pfn_pte(page_to_pfn(ZERO_PAGE(pvmw->address)), 202 pvmw->vma->vm_page_prot)); 203 ptep_clear_flush(pvmw->vma, pvmw->address, pvmw->pte); 204 set_pte_at(pvmw->vma->vm_mm, pvmw->address, pvmw->pte, newpte); 205 dec_mm_counter(pvmw->vma->vm_mm, MM_ANONPAGES); > 206 count_vm_event(THP_SPLIT_REMAP_READONLY_ZERO_PAGE); 207 return true; 208 } 209 210 dec_mm_counter(pvmw->vma->vm_mm, mm_counter(page)); > 211 count_vm_event(THP_SPLIT_UNMAP); 212 return true; 213 } 214 -- 0-DAY CI Kernel Test Service https://01.org/lkp