diff mbox

[v2] powerpc: enforce sane MAX_ORDER

Message ID 1222266548.4257.26.camel@johannes.berg (mailing list archive)
State Accepted, archived
Commit ebe40c5c4c888f2cbfd9f0880a8bc072e6fc3a0d
Headers show

Commit Message

Johannes Berg Sept. 24, 2008, 2:29 p.m. UTC
powerpc uses CONFIG_FORCE_MAX_ZONEORDER, and some things depend on it
being at least 10 when 64k pages are not configured (notably the dart
iommu code with CONFIG_PM). The defaults are fine, but when going from a
64K pages config to one without 64K pages, MAX_ORDER stays at 9 which is
too low for 4K pages.

This patch makes the Kconfig enforce at least the defaults.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---

> We'll I'm ok with that, but I dont think we should be values that
> make  
> no sense.  64 would seem the max even in a 64-bit system.

Indeed, it makes little sense to allow you to set more than the address
space, so here's a version with max 64.

Comments

Timur Tabi Sept. 24, 2008, 4:08 p.m. UTC | #1
On Wed, Sep 24, 2008 at 9:29 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:

> Indeed, it makes little sense to allow you to set more than the address
> space, so here's a version with max 64.

Acked-by: Timur Tabi <timur@freescale.com>

However, the max is actually less than 64.  Assuming a 64-bit address
space, the maximum number of pages in one allocation can be
2^(64-PAGE_SHIFT).  For 4KB pages, the max value for
FORCE_MAX_ZONEORDER is 53.  For 64KB pages, the max is 49.
diff mbox

Patch

--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -415,8 +415,11 @@  config PPC_64K_PAGES
 
 config FORCE_MAX_ZONEORDER
 	int "Maximum zone order"
+	range 9 64 if PPC_64K_PAGES
 	default "9" if PPC_64K_PAGES
+	range 13 64 if PPC64 && !PPC_64K_PAGES
 	default "13" if PPC64 && !PPC_64K_PAGES
+	range 11 64
 	default "11"
 	help
 	  The kernel memory allocator divides physically contiguous memory