[PATCH v2] powerpc: enforce sane MAX_ORDER

2008-09-24 Thread Johannes Berg
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 [EMAIL PROTECTED]
---

 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.

--- 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


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] powerpc: enforce sane MAX_ORDER

2008-09-24 Thread Timur Tabi
On Wed, Sep 24, 2008 at 9:29 AM, Johannes Berg
[EMAIL PROTECTED] 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 [EMAIL PROTECTED]

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.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev