Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on next-20221013] [cannot apply to shuah-kselftest/next v6.0] [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/20221013-065303 config: i386-randconfig-a004-20220822 compiler: gcc-11 (Debian 11.3.0-5) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/ae565d00fb30b75b8c92e327aa3b25211950a0ff git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review alexlzhu-fb-com/THP-Shrinker/20221013-065303 git checkout ae565d00fb30b75b8c92e327aa3b25211950a0ff # 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 errors (new ones prefixed by >>): mm/migrate.c: In function 'try_to_unmap_clean': >> mm/migrate.c:205:32: error: 'THP_SPLIT_REMAP_READONLY_ZERO_PAGE' undeclared (first use in this function) 205 | count_vm_event(THP_SPLIT_REMAP_READONLY_ZERO_PAGE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/migrate.c:205:32: note: each undeclared identifier is reported only once for each function it appears in >> mm/migrate.c:210:24: error: 'THP_SPLIT_UNMAP' undeclared (first use in this function) 210 | count_vm_event(THP_SPLIT_UNMAP); | ^~~~~~~~~~~~~~~ vim +/THP_SPLIT_REMAP_READONLY_ZERO_PAGE +205 mm/migrate.c 170 171 static bool try_to_unmap_clean(struct page_vma_mapped_walk *pvmw, struct page *page) 172 { 173 void *addr; 174 bool dirty; 175 pte_t newpte; 176 177 VM_BUG_ON_PAGE(PageCompound(page), page); 178 VM_BUG_ON_PAGE(!PageAnon(page), page); 179 VM_BUG_ON_PAGE(!PageLocked(page), page); 180 VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page); 181 182 if (PageMlocked(page) || (pvmw->vma->vm_flags & VM_LOCKED)) 183 return false; 184 185 /* 186 * The pmd entry mapping the old thp was flushed and the pte mapping 187 * this subpage has been non present. Therefore, this subpage is 188 * inaccessible. We don't need to remap it if it contains only zeros. 189 */ 190 addr = kmap_local_page(page); 191 dirty = memchr_inv(addr, 0, PAGE_SIZE); 192 kunmap_local(addr); 193 194 if (dirty) 195 return false; 196 197 pte_clear_not_present_full(pvmw->vma->vm_mm, pvmw->address, pvmw->pte, false); 198 199 if (userfaultfd_armed(pvmw->vma)) { 200 newpte = pte_mkspecial(pfn_pte(page_to_pfn(ZERO_PAGE(pvmw->address)), 201 pvmw->vma->vm_page_prot)); 202 ptep_clear_flush(pvmw->vma, pvmw->address, pvmw->pte); 203 set_pte_at(pvmw->vma->vm_mm, pvmw->address, pvmw->pte, newpte); 204 dec_mm_counter(pvmw->vma->vm_mm, MM_ANONPAGES); > 205 count_vm_event(THP_SPLIT_REMAP_READONLY_ZERO_PAGE); 206 return true; 207 } 208 209 dec_mm_counter(pvmw->vma->vm_mm, mm_counter(page)); > 210 count_vm_event(THP_SPLIT_UNMAP); 211 return true; 212 } 213 -- 0-DAY CI Kernel Test Service https://01.org/lkp