Commit 2d2f5119 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds

mm: do not use mm->nr_pmds on !MMU configurations

mm->nr_pmds doesn't make sense on !MMU configurations
Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f48b80a5
...@@ -1447,13 +1447,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, ...@@ -1447,13 +1447,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
#endif #endif
#ifdef __PAGETABLE_PMD_FOLDED #if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
unsigned long address) unsigned long address)
{ {
return 0; return 0;
} }
static inline void mm_nr_pmds_init(struct mm_struct *mm) {}
static inline unsigned long mm_nr_pmds(struct mm_struct *mm) static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
{ {
return 0; return 0;
...@@ -1465,6 +1467,11 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {} ...@@ -1465,6 +1467,11 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {}
#else #else
int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
static inline void mm_nr_pmds_init(struct mm_struct *mm)
{
atomic_long_set(&mm->nr_pmds, 0);
}
static inline unsigned long mm_nr_pmds(struct mm_struct *mm) static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
{ {
return atomic_long_read(&mm->nr_pmds); return atomic_long_read(&mm->nr_pmds);
......
...@@ -555,9 +555,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p) ...@@ -555,9 +555,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p)
INIT_LIST_HEAD(&mm->mmlist); INIT_LIST_HEAD(&mm->mmlist);
mm->core_state = NULL; mm->core_state = NULL;
atomic_long_set(&mm->nr_ptes, 0); atomic_long_set(&mm->nr_ptes, 0);
#ifndef __PAGETABLE_PMD_FOLDED mm_nr_pmds_init(mm);
atomic_long_set(&mm->nr_pmds, 0);
#endif
mm->map_count = 0; mm->map_count = 0;
mm->locked_vm = 0; mm->locked_vm = 0;
mm->pinned_vm = 0; mm->pinned_vm = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment