[PATCH] mm: add nr_pmds into mm_struct unconditionally

From: Kirill A. Shutemov
Date: Tue Jan 27 2015 - 10:59:55 EST


__PAGETABLE_PMD_FOLDED is defined during <asm/pgtable.h> which is not
included into <linux/mm_types.h>. And we cannot include it here since
many of <asm/pgtables> needs <linux/mm_types.h> to define struct page.

I failed to come up with better solution rather than put nr_pmds into
mm_struct unconditionally.

One possible solution would be to expose number of page table levels
architecture has via Kconfig, but that's ugly and requires changes to
all architectures.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
---
include/linux/mm_types.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 79cdf6f5c746..199a03aab8dc 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -364,9 +364,7 @@ struct mm_struct {
atomic_t mm_users; /* How many users with user space? */
atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
atomic_long_t nr_ptes; /* PTE page table pages */
-#ifndef __PAGETABLE_PMD_FOLDED
atomic_long_t nr_pmds; /* PMD page table pages */
-#endif
int map_count; /* number of VMAs */

spinlock_t page_table_lock; /* Protects page tables and some counters */
--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/