linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: [PATCHv3 16/17] mm: define default PGTABLE_LEVELS to two
Date: Thu, 26 Feb 2015 13:35:19 +0200	[thread overview]
Message-ID: <1424950520-90188-17-git-send-email-kirill.shutemov@linux.intel.com> (raw)
In-Reply-To: <1424950520-90188-1-git-send-email-kirill.shutemov@linux.intel.com>

By this time all architectures which support more than two page table
levels should be covered. This patch add default definiton of
PGTABLE_LEVELS equal 2.

We also add assert to detect inconsistence between CONFIG_PGTABLE_LEVELS
and __PAGETABLE_PMD_FOLDED/__PAGETABLE_PUD_FOLDED.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/Kconfig                  | 4 ++++
 include/asm-generic/pgtable.h | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 05d7a8a458d5..a9c95d36ba70 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -484,6 +484,10 @@ config HAVE_IRQ_EXIT_ON_IRQ_STACK
 	  This spares a stack switch and improves cache usage on softirq
 	  processing.
 
+config PGTABLE_LEVELS
+	int
+	default 2
+
 #
 # ABI hall of shame
 #
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 4d46085c1b90..1f9f5da6828f 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -7,6 +7,11 @@
 #include <linux/mm_types.h>
 #include <linux/bug.h>
 
+#if 4 - defined(__PAGETABLE_PUD_FOLDED) - defined(__PAGETABLE_PMD_FOLDED) != \
+	CONFIG_PGTABLE_LEVELS
+#error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{PUD,PMD}_FOLDED
+#endif
+
 /*
  * On almost all architectures and configurations, 0 can be used as the
  * upper ceiling to free_pgtables(): on many architectures it has the same
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-02-26 11:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 11:35 [PATCHv3 00/17] Add missing __PAGETABLE_{PUD,PMD}_FOLDED defines and introduce CONFIG_PGTABLE_LEVELS Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 01/17] mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines Kirill A. Shutemov
2015-02-26 20:04   ` Aaro Koskinen
2015-02-26 11:35 ` [PATCHv3 02/17] alpha: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 03/17] arm64: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 04/17] arm: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 05/17] ia64: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 06/17] m68k: mark PMD folded and expose number of page table levels Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 07/17] mips: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 08/17] parisc: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 09/17] powerpc: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 10/17] s390: expose number of page table levels Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 11/17] sh: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 12/17] sparc: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 13/17] tile: " Kirill A. Shutemov
2015-02-26 15:23   ` Chris Metcalf
2015-02-26 11:35 ` [PATCHv3 14/17] um: " Kirill A. Shutemov
2015-02-26 11:35 ` [PATCHv3 15/17] x86: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-02-26 11:35 ` Kirill A. Shutemov [this message]
2015-02-26 11:35 ` [PATCHv3 17/17] mm: do not add nr_pmds into mm_struct if PMD is folded Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424950520-90188-17-git-send-email-kirill.shutemov@linux.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox