Re: [PATCH 3/3] mm: don't remap clean subpages when splitting isolated thp

From: kernel test robot
Date: Sat Jul 31 2021 - 05:55:16 EST

Hi Yu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc3]
[cannot apply to hnaz-linux-mm/master linux/master next-20210730]
[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]

base: c7d102232649226a69dddd58a4942cf13cff4f7c
config: x86_64-randconfig-a001-20210730 (attached as .config)
compiler: clang version 13.0.0 ( 4f71f59bf3d9914188a11d0c41bedbb339d36ff5)
reproduce (this is a W=1 build):
wget -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add linux-review
git fetch --no-tags linux-review Yu-Zhao/mm-optimize-thp-for-reclaim-and-migration/20210731-144129
git checkout e4e76c4915b364558aacae2cf320a43306a20fa1
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> mm/migrate.c:199:17: error: use of undeclared identifier 'THP_SPLIT_UNMAP'
mm/migrate.c:2606:16: warning: variable 'addr' set but not used [-Wunused-but-set-variable]
unsigned long addr, i, restore = 0;
1 warning and 1 error generated.

vim +/THP_SPLIT_UNMAP +199 mm/migrate.c

171 static bool try_to_unmap_clean(struct page_vma_mapped_walk *pvmw, struct page *page)
172 {
173 void *addr;
174 bool dirty;
176 VM_BUG_ON_PAGE(PageLRU(page), page);
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);
182 if (PageMlocked(page) || (pvmw->vma->vm_flags & VM_LOCKED))
183 return false;
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_atomic(page);
191 dirty = !!memchr_inv(addr, 0, PAGE_SIZE);
192 kunmap_atomic(addr);
194 if (dirty)
195 return false;
197 pte_clear_not_present_full(pvmw->vma->vm_mm, pvmw->address, pvmw->pte, false);
198 dec_mm_counter(pvmw->vma->vm_mm, mm_counter(page));
> 199 count_vm_event(THP_SPLIT_UNMAP);
201 return true;
202 }

0-DAY CI Kernel Test Service, Intel Corporation

Attachment: .config.gz
Description: application/gzip