tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 295ef6ab95e1d8e09e027ef260c50d662a382ef6 commit: cc35cad087f04dd8fa911fbe55c8e910137fc6c1 [3283/3365] huge tmpfs: fix Mlocked meminfo, track huge & unhuge mlocks config: x86_64-randconfig-v0-04071631 (attached as .config) reproduce: git checkout cc35cad087f04dd8fa911fbe55c8e910137fc6c1 # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/asm-generic/bug.h:4:0, from arch/x86/include/asm/bug.h:35, from include/linux/bug.h:4, from include/linux/mmdebug.h:4, from include/linux/mm.h:8, from mm/rmap.c:48: mm/rmap.c: In function 'try_to_unmap_one': include/linux/compiler.h:510:38: error: call to '__compiletime_assert_1447' declared with attribute error: BUILD_BUG failed _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) ^ include/linux/compiler.h:493:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^ include/linux/compiler.h:510:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) ^ include/linux/bug.h:51:37: note: in expansion of macro 'compiletime_assert' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/bug.h:85:21: note: in expansion of macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") ^ include/linux/huge_mm.h:170:28: note: in expansion of macro 'BUILD_BUG' #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) ^ >> include/linux/huge_mm.h:52:26: note: in expansion of macro 'HPAGE_PMD_SHIFT' #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) ^ >> include/linux/huge_mm.h:53:26: note: in expansion of macro 'HPAGE_PMD_ORDER' #define HPAGE_PMD_NR (1<> mm/rmap.c:1447:36: note: in expansion of macro 'HPAGE_PMD_NR' mlock_vma_pages(page, pte ? 1 : HPAGE_PMD_NR); ^ vim +/HPAGE_PMD_ORDER +53 include/linux/huge_mm.h 79da5407e Kirill A. Shutemov 2012-12-12 46 TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG, 71e3aac07 Andrea Arcangeli 2011-01-13 47 #ifdef CONFIG_DEBUG_VM 71e3aac07 Andrea Arcangeli 2011-01-13 48 TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, 71e3aac07 Andrea Arcangeli 2011-01-13 49 #endif 71e3aac07 Andrea Arcangeli 2011-01-13 50 }; 71e3aac07 Andrea Arcangeli 2011-01-13 51 d8c37c480 Naoya Horiguchi 2012-03-21 @52 #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) d8c37c480 Naoya Horiguchi 2012-03-21 @53 #define HPAGE_PMD_NR (1<vm_flags & VM_HUGEPAGE))) && \ a7d6e4ecd Andrea Arcangeli 2011-02-15 71 !((__vma)->vm_flags & VM_NOHUGEPAGE) && \ a7d6e4ecd Andrea Arcangeli 2011-02-15 72 !is_vma_temporary_stack(__vma)) 79da5407e Kirill A. Shutemov 2012-12-12 73 #define transparent_hugepage_use_zero_page() \ 79da5407e Kirill A. Shutemov 2012-12-12 74 (transparent_hugepage_flags & \ 79da5407e Kirill A. Shutemov 2012-12-12 75 (1<vm_mm->mmap_sem), vma); 5c7fb56e5 Dan Williams 2016-01-15 125 if (pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) b6ec57f4b Kirill A. Shutemov 2016-01-21 126 return __pmd_trans_huge_lock(pmd, vma); 025c5b245 Naoya Horiguchi 2012-03-21 127 else 969e8d7e4 Chen Gang 2016-04-01 128 return NULL; 025c5b245 Naoya Horiguchi 2012-03-21 129 } 40b0a093a Hugh Dickins 2016-04-07 130 40b0a093a Hugh Dickins 2016-04-07 131 /* Repeat definition from linux/pageteam.h to force error if different */ 40b0a093a Hugh Dickins 2016-04-07 132 #define TEAM_LRU_WEIGHT_MASK ((1L << (HPAGE_PMD_ORDER + 1)) - 1) 40b0a093a Hugh Dickins 2016-04-07 133 40b0a093a Hugh Dickins 2016-04-07 134 /* 40b0a093a Hugh Dickins 2016-04-07 135 * hpage_nr_pages(page) returns the current LRU weight of the page. 40b0a093a Hugh Dickins 2016-04-07 136 * Beware of races when it is used: an Anon THPage might get split, 40b0a093a Hugh Dickins 2016-04-07 137 * so may need protection by compound lock or lruvec lock; a huge tmpfs 40b0a093a Hugh Dickins 2016-04-07 138 * team page might have weight 1 shifted from tail to head, or back to 40b0a093a Hugh Dickins 2016-04-07 139 * tail when disbanded, so may need protection by lruvec lock. 40b0a093a Hugh Dickins 2016-04-07 140 */ 2c888cfbc Rik van Riel 2011-01-13 141 static inline int hpage_nr_pages(struct page *page) 2c888cfbc Rik van Riel 2011-01-13 142 { 2c888cfbc Rik van Riel 2011-01-13 143 if (unlikely(PageTransHuge(page))) 2c888cfbc Rik van Riel 2011-01-13 144 return HPAGE_PMD_NR; 40b0a093a Hugh Dickins 2016-04-07 145 if (PageTeam(page)) 40b0a093a Hugh Dickins 2016-04-07 146 return atomic_long_read(&page->team_usage) & 40b0a093a Hugh Dickins 2016-04-07 147 TEAM_LRU_WEIGHT_MASK; 2c888cfbc Rik van Riel 2011-01-13 148 return 1; 2c888cfbc Rik van Riel 2011-01-13 149 } d10e63f29 Mel Gorman 2012-10-25 150 4daae3b4b Mel Gorman 2012-11-02 151 extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, 4daae3b4b Mel Gorman 2012-11-02 152 unsigned long addr, pmd_t pmd, pmd_t *pmdp); d10e63f29 Mel Gorman 2012-10-25 153 56873f43a Wang, Yalin 2015-02-11 154 extern struct page *huge_zero_page; 56873f43a Wang, Yalin 2015-02-11 155 56873f43a Wang, Yalin 2015-02-11 156 static inline bool is_huge_zero_page(struct page *page) 56873f43a Wang, Yalin 2015-02-11 157 { 56873f43a Wang, Yalin 2015-02-11 158 return ACCESS_ONCE(huge_zero_page) == page; 56873f43a Wang, Yalin 2015-02-11 159 } 56873f43a Wang, Yalin 2015-02-11 160 fc4370443 Matthew Wilcox 2015-09-08 161 static inline bool is_huge_zero_pmd(pmd_t pmd) fc4370443 Matthew Wilcox 2015-09-08 162 { fc4370443 Matthew Wilcox 2015-09-08 163 return is_huge_zero_page(pmd_page(pmd)); fc4370443 Matthew Wilcox 2015-09-08 164 } fc4370443 Matthew Wilcox 2015-09-08 165 fc4370443 Matthew Wilcox 2015-09-08 166 struct page *get_huge_zero_page(void); 0fa423dfb Kirill A. Shutemov 2016-04-07 167 void put_huge_zero_page(void); fc4370443 Matthew Wilcox 2015-09-08 168 71e3aac07 Andrea Arcangeli 2011-01-13 169 #else /* CONFIG_TRANSPARENT_HUGEPAGE */ d8c37c480 Naoya Horiguchi 2012-03-21 @170 #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) d8c37c480 Naoya Horiguchi 2012-03-21 171 #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) d8c37c480 Naoya Horiguchi 2012-03-21 172 #define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; }) 71e3aac07 Andrea Arcangeli 2011-01-13 173 :::::: The code at line 53 was first introduced by commit :::::: d8c37c480678ebe09bc570f33e085e28049db035 thp: add HPAGE_PMD_* definitions for !CONFIG_TRANSPARENT_HUGEPAGE :::::: TO: Naoya Horiguchi :::::: CC: Linus Torvalds --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation