aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index fcf9cc9d535f..5411de93a363 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1744,11 +1744,15 @@ int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address);
1744 1744
1745static inline void mm_inc_nr_puds(struct mm_struct *mm) 1745static inline void mm_inc_nr_puds(struct mm_struct *mm)
1746{ 1746{
1747 if (mm_pud_folded(mm))
1748 return;
1747 atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); 1749 atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
1748} 1750}
1749 1751
1750static inline void mm_dec_nr_puds(struct mm_struct *mm) 1752static inline void mm_dec_nr_puds(struct mm_struct *mm)
1751{ 1753{
1754 if (mm_pud_folded(mm))
1755 return;
1752 atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); 1756 atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
1753} 1757}
1754#endif 1758#endif
@@ -1768,11 +1772,15 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
1768 1772
1769static inline void mm_inc_nr_pmds(struct mm_struct *mm) 1773static inline void mm_inc_nr_pmds(struct mm_struct *mm)
1770{ 1774{
1775 if (mm_pmd_folded(mm))
1776 return;
1771 atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); 1777 atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
1772} 1778}
1773 1779
1774static inline void mm_dec_nr_pmds(struct mm_struct *mm) 1780static inline void mm_dec_nr_pmds(struct mm_struct *mm)
1775{ 1781{
1782 if (mm_pmd_folded(mm))
1783 return;
1776 atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); 1784 atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
1777} 1785}
1778#endif 1786#endif