linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: linux-mm@kvack.org
Cc: Dave Hansen <haveblue@us.ibm.com>
Subject: [RFC][PATCH 5/7] parisc generic PAGE_SIZE
Date: Mon, 28 Aug 2006 08:44:16 -0700	[thread overview]
Message-ID: <20060828154416.DA5B0D64@localhost.localdomain> (raw)
In-Reply-To: <20060828154413.E05721BD@localhost.localdomain>

This is the parisc portion to convert it over to the generic PAGE_SIZE
framework.

* remove parisc-specific Kconfig menu
* add parisc default of 4k pages to mm/Kconfig
* replace parisc Kconfig menu with plain bool Kconfig option to
  cover both 16KB and 64KB pages: PARISC_LARGER_PAGE_SIZES.
  This preserves the dependencies on PA8X00.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 threadalloc-dave/include/asm-parisc/pgtable.h |    8 +++---
 threadalloc-dave/include/asm-parisc/page.h    |   25 ---------------------
 threadalloc-dave/arch/parisc/Kconfig          |   30 +++-----------------------
 threadalloc-dave/arch/parisc/defconfig        |    6 ++---
 threadalloc-dave/arch/parisc/mm/init.c        |    2 -
 threadalloc-dave/mm/Kconfig                   |    7 +++---
 6 files changed, 17 insertions(+), 61 deletions(-)

diff -puN include/asm-parisc/pgtable.h~parisc include/asm-parisc/pgtable.h
--- threadalloc/include/asm-parisc/pgtable.h~parisc	2006-08-25 11:34:21.000000000 -0700
+++ threadalloc-dave/include/asm-parisc/pgtable.h	2006-08-25 11:34:25.000000000 -0700
@@ -66,7 +66,7 @@
 #endif
 #define KERNEL_INITIAL_SIZE	(1 << KERNEL_INITIAL_ORDER)
 
-#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
+#if defined(CONFIG_64BIT) && defined(CONFIG_PAGE_SIZE_4KB)
 #define PT_NLEVELS	3
 #define PGD_ORDER	1 /* Number of pages per pgd */
 #define PMD_ORDER	1 /* Number of pages per pmd */
@@ -514,11 +514,11 @@ static inline void ptep_set_wrprotect(st
 #define _PAGE_SIZE_ENCODING_16M		6
 #define _PAGE_SIZE_ENCODING_64M		7
 
-#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
+#if defined(CONFIG_PAGE_SIZE_4KB)
 # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K
-#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
+#elif defined(CONFIG_PAGE_SIZE_16KB)
 # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K
-#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
+#elif defined(CONFIG_PAGE_SIZE_64KB)
 # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K
 #endif
 
diff -puN include/asm-parisc/page.h~parisc include/asm-parisc/page.h
--- threadalloc/include/asm-parisc/page.h~parisc	2006-08-25 11:34:21.000000000 -0700
+++ threadalloc-dave/include/asm-parisc/page.h	2006-08-25 11:34:25.000000000 -0700
@@ -1,29 +1,10 @@
 #ifndef _PARISC_PAGE_H
 #define _PARISC_PAGE_H
 
-#if !defined(__KERNEL__)
-/* this is for userspace applications (4k page size) */
-# define PAGE_SHIFT	12	/* 4k */
-# define PAGE_SIZE	(1UL << PAGE_SHIFT)
-# define PAGE_MASK	(~(PAGE_SIZE-1))
-#endif
-
+#include <asm-generic/page.h>
 
 #ifdef __KERNEL__
 
-#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
-# define PAGE_SHIFT	12	/* 4k */
-#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
-# define PAGE_SHIFT	14	/* 16k */
-#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
-# define PAGE_SHIFT	16	/* 64k */
-#else
-# error "unknown default kernel page size"
-#endif
-#define PAGE_SIZE	(1UL << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
-
-
 #ifndef __ASSEMBLY__
 
 #include <asm/types.h>
@@ -140,10 +121,6 @@ extern int npmem_ranges;
 #define PMD_ENTRY_SIZE	(1UL << BITS_PER_PMD_ENTRY)
 #define PTE_ENTRY_SIZE	(1UL << BITS_PER_PTE_ENTRY)
 
-/* to align the pointer to the (next) page boundary */
-#define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
-
-
 #define LINUX_GATEWAY_SPACE     0
 
 /* This governs the relationship between virtual and physical addresses.
diff -puN arch/parisc/Kconfig~parisc arch/parisc/Kconfig
--- threadalloc/arch/parisc/Kconfig~parisc	2006-08-25 11:34:21.000000000 -0700
+++ threadalloc-dave/arch/parisc/Kconfig	2006-08-25 11:34:25.000000000 -0700
@@ -142,34 +142,12 @@ config 64BIT
 	  enable this option otherwise. The 64bit kernel is significantly bigger
 	  and slower than the 32bit one.
 
-choice
-	prompt "Kernel page size"
-	default PARISC_PAGE_SIZE_4KB  if !64BIT
-	default PARISC_PAGE_SIZE_4KB  if 64BIT
-#	default PARISC_PAGE_SIZE_16KB if 64BIT
-
-config PARISC_PAGE_SIZE_4KB
-	bool "4KB"
-	help
-	  This lets you select the page size of the kernel.  For best
-	  performance, a page size of 16KB is recommended.  For best
-	  compatibility with 32bit applications, a page size of 4KB should be
-	  selected (the vast majority of 32bit binaries work perfectly fine
-	  with a larger page size).
-
-	  4KB                For best 32bit compatibility
-	  16KB               For best performance
-	  64KB               For best performance, might give more overhead.
-
-	  If you don't know what to do, choose 4KB.
-
-config PARISC_PAGE_SIZE_16KB
-	bool "16KB (EXPERIMENTAL)"
+config PARISC_LARGER_PAGE_SIZES
+	def_bool y
 	depends on PA8X00 && EXPERIMENTAL
 
-config PARISC_PAGE_SIZE_64KB
-	bool "64KB (EXPERIMENTAL)"
-	depends on PA8X00 && EXPERIMENTAL
+config ARCH_GENERIC_PAGE_SIZE
+	def_bool y
 
 endchoice
 
diff -puN arch/parisc/defconfig~parisc arch/parisc/defconfig
--- threadalloc/arch/parisc/defconfig~parisc	2006-08-25 11:34:21.000000000 -0700
+++ threadalloc-dave/arch/parisc/defconfig	2006-08-25 11:34:25.000000000 -0700
@@ -91,9 +91,9 @@ CONFIG_PA7100LC=y
 # CONFIG_PA7300LC is not set
 # CONFIG_PA8X00 is not set
 CONFIG_PA11=y
-CONFIG_PARISC_PAGE_SIZE_4KB=y
-# CONFIG_PARISC_PAGE_SIZE_16KB is not set
-# CONFIG_PARISC_PAGE_SIZE_64KB is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_SMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 # CONFIG_PREEMPT_NONE is not set
diff -puN arch/parisc/mm/init.c~parisc arch/parisc/mm/init.c
--- threadalloc/arch/parisc/mm/init.c~parisc	2006-08-25 11:34:21.000000000 -0700
+++ threadalloc-dave/arch/parisc/mm/init.c	2006-08-25 11:34:25.000000000 -0700
@@ -642,7 +642,7 @@ static void __init map_pages(unsigned lo
 				 * Map the fault vector writable so we can
 				 * write the HPMC checksum.
 				 */
-#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
+#if defined(CONFIG_PAGE_SIZE_4KB)
 				if (address >= ro_start && address < ro_end
 							&& address != fv_addr
 							&& address != gw_addr)
diff -puN mm/Kconfig~parisc mm/Kconfig
--- threadalloc/mm/Kconfig~parisc	2006-08-25 11:34:25.000000000 -0700
+++ threadalloc-dave/mm/Kconfig	2006-08-25 11:34:25.000000000 -0700
@@ -6,7 +6,7 @@
 choice
 	prompt "Kernel Page Size"
 	depends on ARCH_GENERIC_PAGE_SIZE
-	default PAGE_SIZE_4KB if MIPS
+	default PAGE_SIZE_4KB if MIPS || PARISC
 	default PAGE_SIZE_8KB if SPARC64
 	default PAGE_SIZE_16KB if IA64
 config PAGE_SIZE_4KB
@@ -30,10 +30,11 @@ config PAGE_SIZE_8KB
 	depends on IA64 || SPARC64 || MIPS_PAGE_SIZE_8KB
 config PAGE_SIZE_16KB
 	bool "16KB"
-	depends on IA64 || MIPS_PAGE_SIZE_16KB
+	depends on IA64 || MIPS_PAGE_SIZE_16KB || PARISC_LARGER_PAGE_SIZES
 config PAGE_SIZE_64KB
 	bool "64KB"
-	depends on (IA64 && !ITANIUM) || SPARC64 || MIPS_PAGE_SIZE_64KB
+	depends on (IA64 && !ITANIUM) || SPARC64 || MIPS_PAGE_SIZE_64KB || \
+		   PARISC_LARGER_PAGE_SIZES
 config PAGE_SIZE_512KB
 	bool "512KB"
 	depends on SPARC64
_

--
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:[~2006-08-28 15:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-28 15:44 [RFC][PATCH 1/7] generic PAGE_SIZE infrastructure (v2) Dave Hansen
2006-08-28 15:44 ` [RFC][PATCH 3/7] sparc64 generic PAGE_SIZE Dave Hansen
2006-08-28 15:44 ` [RFC][PATCH 2/7] ia64 " Dave Hansen
2006-08-28 17:04   ` Christoph Lameter
2006-08-28 17:22     ` Dave Hansen
2006-08-28 17:32       ` Christoph Lameter
2006-08-28 17:45         ` Dave Hansen
2006-08-29  2:46   ` [RFC][PATCH 1/7] generic PAGE_SIZE infrastructure (v2) Paul Mundt
2006-08-29  3:51     ` Randy.Dunlap
2006-08-29  3:55       ` Paul Mundt
2006-08-29  4:02         ` Randy.Dunlap
2006-08-29 15:29     ` Dave Hansen
2006-08-30  0:37       ` Randy.Dunlap
2006-08-28 15:44 ` [RFC][PATCH 4/7] mips generic PAGE_SIZE Dave Hansen
2006-08-28 15:44 ` [RFC][PATCH 6/7] powerpc " Dave Hansen
2006-08-28 15:44 ` Dave Hansen [this message]
2006-08-28 15:44 ` [RFC][PATCH 7/7] convert the "easy" architectures to " Dave Hansen
2006-08-28 17:01 ` [RFC][PATCH 1/7] generic PAGE_SIZE infrastructure (v2) Christoph Lameter
2006-08-28 17:11   ` Dave Hansen
2006-08-28 23:32     ` Peter Chubb
2006-08-29 18:59       ` Dave Hansen
2006-08-28 20:53   ` Dave Hansen
2006-08-28 21:44     ` Christoph Lameter

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=20060828154416.DA5B0D64@localhost.localdomain \
    --to=haveblue@us.ibm.com \
    --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