Hi Yu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/x86/core]
[also build test ERROR on tip/x86/mm tip/sched/core linus/master v5.12-rc2]
[cannot apply to cgroup/for-next tip/perf/core hnaz-linux-mm/master next-20210312]
[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]
url:
https://github.com/0day-ci/linux/commits/Yu-Zhao/Multigenerational-LRU/20...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
d0962f2b24c99889a386f0658c71535f56358f77
config: mips-randconfig-r036-20210313 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
dfd27ebbd0eb137c9a439b7c537bb87ba903efd3)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
#
https://github.com/0day-ci/linux/commit/7a8b80d7f0d02852d49395fc6e0357438...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yu-Zhao/Multigenerational-LRU/20210313-160036
git checkout 7a8b80d7f0d02852d49395fc6e035743816f6b1d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> mm/vmscan.c:4776:56: error: implicit declaration of function
'pmd_young' [-Werror,-Wimplicit-function-declaration]
if
(IS_ENABLED(CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG) && !pmd_young(pmd))
^
mm/vmscan.c:4776:56: note: did you mean 'pte_young'?
arch/mips/include/asm/pgtable.h:365:19: note: 'pte_young' declared here
static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
^
> mm/vmscan.c:4851:23: error: implicit declaration of function
'pmd_pfn' [-Werror,-Wimplicit-function-declaration]
unsigned long pfn = pmd_pfn(*pmd);
^
mm/vmscan.c:4851:23: note: did you mean 'pmd_off'?
include/linux/pgtable.h:131:22: note: 'pmd_off' declared here
static inline pmd_t *pmd_off(struct mm_struct *mm, unsigned long va)
^
mm/vmscan.c:4853:30: error: implicit declaration of function 'pmd_young'
[-Werror,-Wimplicit-function-declaration]
if (!pmd_present(*pmd) || !pmd_young(*pmd) || is_huge_zero_pmd(*pmd))
^
> mm/vmscan.c:4882:7: error: implicit declaration of function
'pmd_dirty' [-Werror,-Wimplicit-function-declaration]
if
(pmd_dirty(*pmd) && !PageDirty(page) &&
^
mm/vmscan.c:4882:7: note: did you mean 'pte_dirty'?
arch/mips/include/asm/pgtable.h:364:19: note: 'pte_dirty' declared here
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
^
4 errors generated.
vim +/pmd_young +4776 mm/vmscan.c
4c59e20072808a Yu Zhao 2021-03-13 4759
4c59e20072808a Yu Zhao 2021-03-13 4760 static int walk_pte_range(pmd_t *pmdp, unsigned
long start, unsigned long end,
4c59e20072808a Yu Zhao 2021-03-13 4761 struct mm_walk *walk)
4c59e20072808a Yu Zhao 2021-03-13 4762 {
4c59e20072808a Yu Zhao 2021-03-13 4763 pmd_t pmd;
4c59e20072808a Yu Zhao 2021-03-13 4764 pte_t *pte;
4c59e20072808a Yu Zhao 2021-03-13 4765 spinlock_t *ptl;
4c59e20072808a Yu Zhao 2021-03-13 4766 struct mm_walk_args *args = walk->private;
4c59e20072808a Yu Zhao 2021-03-13 4767 int old_gen, new_gen =
lru_gen_from_seq(args->max_seq);
4c59e20072808a Yu Zhao 2021-03-13 4768
4c59e20072808a Yu Zhao 2021-03-13 4769 pmd = pmd_read_atomic(pmdp);
4c59e20072808a Yu Zhao 2021-03-13 4770 barrier();
4c59e20072808a Yu Zhao 2021-03-13 4771 if (!pmd_present(pmd) || pmd_trans_huge(pmd))
4c59e20072808a Yu Zhao 2021-03-13 4772 return 0;
4c59e20072808a Yu Zhao 2021-03-13 4773
4c59e20072808a Yu Zhao 2021-03-13 4774 VM_BUG_ON(pmd_huge(pmd) || pmd_devmap(pmd) ||
is_hugepd(__hugepd(pmd_val(pmd))));
4c59e20072808a Yu Zhao 2021-03-13 4775
4c59e20072808a Yu Zhao 2021-03-13 @4776 if
(IS_ENABLED(CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG) && !pmd_young(pmd))
4c59e20072808a Yu Zhao 2021-03-13 4777 return 0;
4c59e20072808a Yu Zhao 2021-03-13 4778
4c59e20072808a Yu Zhao 2021-03-13 4779 pte = pte_offset_map_lock(walk->mm, &pmd,
start, &ptl);
4c59e20072808a Yu Zhao 2021-03-13 4780 arch_enter_lazy_mmu_mode();
4c59e20072808a Yu Zhao 2021-03-13 4781
4c59e20072808a Yu Zhao 2021-03-13 4782 for (; start != end; pte++, start += PAGE_SIZE)
{
4c59e20072808a Yu Zhao 2021-03-13 4783 struct page *page;
4c59e20072808a Yu Zhao 2021-03-13 4784 unsigned long pfn = pte_pfn(*pte);
4c59e20072808a Yu Zhao 2021-03-13 4785
4c59e20072808a Yu Zhao 2021-03-13 4786 if (!pte_present(*pte) || !pte_young(*pte) ||
is_zero_pfn(pfn))
4c59e20072808a Yu Zhao 2021-03-13 4787 continue;
4c59e20072808a Yu Zhao 2021-03-13 4788
4c59e20072808a Yu Zhao 2021-03-13 4789 /*
4c59e20072808a Yu Zhao 2021-03-13 4790 * If this pte maps a page from a different
node, set the
4c59e20072808a Yu Zhao 2021-03-13 4791 * bitmap to prevent the accessed bit on its
parent pmd from
4c59e20072808a Yu Zhao 2021-03-13 4792 * being cleared.
4c59e20072808a Yu Zhao 2021-03-13 4793 */
4c59e20072808a Yu Zhao 2021-03-13 4794 if (pfn < args->start_pfn || pfn >=
args->end_pfn) {
4c59e20072808a Yu Zhao 2021-03-13 4795 args->addr_bitmap |= get_addr_mask(start);
4c59e20072808a Yu Zhao 2021-03-13 4796 continue;
4c59e20072808a Yu Zhao 2021-03-13 4797 }
4c59e20072808a Yu Zhao 2021-03-13 4798
4c59e20072808a Yu Zhao 2021-03-13 4799 page = compound_head(pte_page(*pte));
4c59e20072808a Yu Zhao 2021-03-13 4800 if (page_to_nid(page) != args->node_id) {
4c59e20072808a Yu Zhao 2021-03-13 4801 args->addr_bitmap |= get_addr_mask(start);
4c59e20072808a Yu Zhao 2021-03-13 4802 continue;
4c59e20072808a Yu Zhao 2021-03-13 4803 }
4c59e20072808a Yu Zhao 2021-03-13 4804 if (page_memcg_rcu(page) != args->memcg)
4c59e20072808a Yu Zhao 2021-03-13 4805 continue;
4c59e20072808a Yu Zhao 2021-03-13 4806
4c59e20072808a Yu Zhao 2021-03-13 4807 if (ptep_test_and_clear_young(walk->vma,
start, pte)) {
4c59e20072808a Yu Zhao 2021-03-13 4808 old_gen = page_update_lru_gen(page, new_gen);
4c59e20072808a Yu Zhao 2021-03-13 4809 if (old_gen >= 0 && old_gen !=
new_gen) {
4c59e20072808a Yu Zhao 2021-03-13 4810 update_batch_size(page, old_gen, new_gen);
4c59e20072808a Yu Zhao 2021-03-13 4811 args->batch_size++;
4c59e20072808a Yu Zhao 2021-03-13 4812 }
4c59e20072808a Yu Zhao 2021-03-13 4813 }
4c59e20072808a Yu Zhao 2021-03-13 4814
4c59e20072808a Yu Zhao 2021-03-13 4815 if (pte_dirty(*pte) && !PageDirty(page)
&&
4c59e20072808a Yu Zhao 2021-03-13 4816 !(PageAnon(page) &&
PageSwapBacked(page) && !PageSwapCache(page)))
4c59e20072808a Yu Zhao 2021-03-13 4817 set_page_dirty(page);
4c59e20072808a Yu Zhao 2021-03-13 4818 }
4c59e20072808a Yu Zhao 2021-03-13 4819
4c59e20072808a Yu Zhao 2021-03-13 4820 arch_leave_lazy_mmu_mode();
4c59e20072808a Yu Zhao 2021-03-13 4821 pte_unmap_unlock(pte, ptl);
4c59e20072808a Yu Zhao 2021-03-13 4822
4c59e20072808a Yu Zhao 2021-03-13 4823 return 0;
4c59e20072808a Yu Zhao 2021-03-13 4824 }
4c59e20072808a Yu Zhao 2021-03-13 4825
4c59e20072808a Yu Zhao 2021-03-13 4826 static int walk_pmd_range(pud_t *pudp, unsigned
long start, unsigned long end,
4c59e20072808a Yu Zhao 2021-03-13 4827 struct mm_walk *walk)
4c59e20072808a Yu Zhao 2021-03-13 4828 {
4c59e20072808a Yu Zhao 2021-03-13 4829 pud_t pud;
4c59e20072808a Yu Zhao 2021-03-13 4830 pmd_t *pmd;
4c59e20072808a Yu Zhao 2021-03-13 4831 spinlock_t *ptl;
4c59e20072808a Yu Zhao 2021-03-13 4832 struct mm_walk_args *args = walk->private;
4c59e20072808a Yu Zhao 2021-03-13 4833 int old_gen, new_gen =
lru_gen_from_seq(args->max_seq);
4c59e20072808a Yu Zhao 2021-03-13 4834
4c59e20072808a Yu Zhao 2021-03-13 4835 pud = READ_ONCE(*pudp);
4c59e20072808a Yu Zhao 2021-03-13 4836 if (!pud_present(pud) ||
WARN_ON_ONCE(pud_trans_huge(pud)))
4c59e20072808a Yu Zhao 2021-03-13 4837 return 0;
4c59e20072808a Yu Zhao 2021-03-13 4838
4c59e20072808a Yu Zhao 2021-03-13 4839 VM_BUG_ON(pud_huge(pud) || pud_devmap(pud) ||
is_hugepd(__hugepd(pud_val(pud))));
4c59e20072808a Yu Zhao 2021-03-13 4840
4c59e20072808a Yu Zhao 2021-03-13 4841 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)
&&
4c59e20072808a Yu Zhao 2021-03-13 4842
!IS_ENABLED(CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG))
4c59e20072808a Yu Zhao 2021-03-13 4843 goto done;
4c59e20072808a Yu Zhao 2021-03-13 4844
4c59e20072808a Yu Zhao 2021-03-13 4845 pmd = pmd_offset(&pud, start);
4c59e20072808a Yu Zhao 2021-03-13 4846 ptl = pmd_lock(walk->mm, pmd);
4c59e20072808a Yu Zhao 2021-03-13 4847 arch_enter_lazy_mmu_mode();
4c59e20072808a Yu Zhao 2021-03-13 4848
4c59e20072808a Yu Zhao 2021-03-13 4849 for (; start != end; pmd++, start =
pmd_addr_end(start, end)) {
4c59e20072808a Yu Zhao 2021-03-13 4850 struct page *page;
4c59e20072808a Yu Zhao 2021-03-13 @4851 unsigned long pfn = pmd_pfn(*pmd);
4c59e20072808a Yu Zhao 2021-03-13 4852
4c59e20072808a Yu Zhao 2021-03-13 4853 if (!pmd_present(*pmd) || !pmd_young(*pmd) ||
is_huge_zero_pmd(*pmd))
4c59e20072808a Yu Zhao 2021-03-13 4854 continue;
4c59e20072808a Yu Zhao 2021-03-13 4855
4c59e20072808a Yu Zhao 2021-03-13 4856 if (!pmd_trans_huge(*pmd)) {
4c59e20072808a Yu Zhao 2021-03-13 4857 if (!(args->addr_bitmap &
get_addr_mask(start)) &&
4c59e20072808a Yu Zhao 2021-03-13 4858 (!(pmd_addr_end(start, end) &
~PMD_MASK) ||
4c59e20072808a Yu Zhao 2021-03-13 4859 !walk->vma->vm_next ||
4c59e20072808a Yu Zhao 2021-03-13 4860 (walk->vma->vm_next->vm_start
& PMD_MASK) > end))
4c59e20072808a Yu Zhao 2021-03-13 4861 pmdp_test_and_clear_young(walk->vma,
start, pmd);
4c59e20072808a Yu Zhao 2021-03-13 4862 continue;
4c59e20072808a Yu Zhao 2021-03-13 4863 }
4c59e20072808a Yu Zhao 2021-03-13 4864
4c59e20072808a Yu Zhao 2021-03-13 4865 if (pfn < args->start_pfn || pfn >=
args->end_pfn)
4c59e20072808a Yu Zhao 2021-03-13 4866 continue;
4c59e20072808a Yu Zhao 2021-03-13 4867
4c59e20072808a Yu Zhao 2021-03-13 4868 page = pmd_page(*pmd);
4c59e20072808a Yu Zhao 2021-03-13 4869 if (page_to_nid(page) != args->node_id)
4c59e20072808a Yu Zhao 2021-03-13 4870 continue;
4c59e20072808a Yu Zhao 2021-03-13 4871 if (page_memcg_rcu(page) != args->memcg)
4c59e20072808a Yu Zhao 2021-03-13 4872 continue;
4c59e20072808a Yu Zhao 2021-03-13 4873
4c59e20072808a Yu Zhao 2021-03-13 4874 if (pmdp_test_and_clear_young(walk->vma,
start, pmd)) {
4c59e20072808a Yu Zhao 2021-03-13 4875 old_gen = page_update_lru_gen(page, new_gen);
4c59e20072808a Yu Zhao 2021-03-13 4876 if (old_gen >= 0 && old_gen !=
new_gen) {
4c59e20072808a Yu Zhao 2021-03-13 4877 update_batch_size(page, old_gen, new_gen);
4c59e20072808a Yu Zhao 2021-03-13 4878 args->batch_size++;
4c59e20072808a Yu Zhao 2021-03-13 4879 }
4c59e20072808a Yu Zhao 2021-03-13 4880 }
4c59e20072808a Yu Zhao 2021-03-13 4881
4c59e20072808a Yu Zhao 2021-03-13 @4882 if (pmd_dirty(*pmd) && !PageDirty(page)
&&
4c59e20072808a Yu Zhao 2021-03-13 4883 !(PageAnon(page) &&
PageSwapBacked(page) && !PageSwapCache(page)))
4c59e20072808a Yu Zhao 2021-03-13 4884 set_page_dirty(page);
4c59e20072808a Yu Zhao 2021-03-13 4885 }
4c59e20072808a Yu Zhao 2021-03-13 4886
4c59e20072808a Yu Zhao 2021-03-13 4887 arch_leave_lazy_mmu_mode();
4c59e20072808a Yu Zhao 2021-03-13 4888 spin_unlock(ptl);
4c59e20072808a Yu Zhao 2021-03-13 4889 done:
4c59e20072808a Yu Zhao 2021-03-13 4890 args->addr_bitmap = 0;
4c59e20072808a Yu Zhao 2021-03-13 4891
4c59e20072808a Yu Zhao 2021-03-13 4892 if (args->batch_size < MAX_BATCH_SIZE)
4c59e20072808a Yu Zhao 2021-03-13 4893 return 0;
4c59e20072808a Yu Zhao 2021-03-13 4894
4c59e20072808a Yu Zhao 2021-03-13 4895 args->next_addr = end;
4c59e20072808a Yu Zhao 2021-03-13 4896
4c59e20072808a Yu Zhao 2021-03-13 4897 return -EAGAIN;
4c59e20072808a Yu Zhao 2021-03-13 4898 }
4c59e20072808a Yu Zhao 2021-03-13 4899
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org