android_kernel_samsung_msm8976/arch/powerpc/mm
Benjamin Herrenschmidt d0f13e3c20 [POWERPC] Introduce address space "slices"
The basic issue is to be able to do what hugetlbfs does but with
different page sizes for some other special filesystems; more
specifically, my need is:

 - Huge pages

 - SPE local store mappings using 64K pages on a 4K base page size
kernel on Cell

 - Some special 4K segments in 64K-page kernels for mapping a dodgy
type of powerpc-specific infiniband hardware that requires 4K MMU
mappings for various reasons I won't explain here.

The main issues are:

 - To maintain/keep track of the page size per "segment" (as we can
only have one page size per segment on powerpc, which are 256MB
divisions of the address space).

 - To make sure special mappings stay within their allotted
"segments" (including MAP_FIXED crap)

 - To make sure everybody else doesn't mmap/brk/grow_stack into a
"segment" that is used for a special mapping

Some of the necessary mechanisms to handle that were present in the
hugetlbfs code, but mostly in ways not suitable for anything else.

The patch relies on some changes to the generic get_unmapped_area()
that just got merged.  It still hijacks hugetlb callbacks here or
there as the generic code hasn't been entirely cleaned up yet but
that shouldn't be a problem.

So what is a slice ?  Well, I re-used the mechanism used formerly by our
hugetlbfs implementation which divides the address space in
"meta-segments" which I called "slices".  The division is done using
256MB slices below 4G, and 1T slices above.  Thus the address space is
divided currently into 16 "low" slices and 16 "high" slices.  (Special
case: high slice 0 is the area between 4G and 1T).

Doing so simplifies significantly the tracking of segments and avoids
having to keep track of all the 256MB segments in the address space.

While I used the "concepts" of hugetlbfs, I mostly re-implemented
everything in a more generic way and "ported" hugetlbfs to it.

Slices can have an associated page size, which is encoded in the mmu
context and used by the SLB miss handler to set the segment sizes.  The
hash code currently doesn't care, it has a specific check for hugepages,
though I might add a mechanism to provide per-slice hash mapping
functions in the future.

The slice code provide a pair of "generic" get_unmapped_area() (bottomup
and topdown) functions that should work with any slice size.  There is
some trickiness here so I would appreciate people to have a look at the
implementation of these and let me know if I got something wrong.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-05-09 16:35:00 +10:00
..
4xx_mmu.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
44x_mmu.c [POWERPC] Revise PPC44x MMU code for arch/powerpc 2007-05-02 20:04:29 +10:00
fault.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-05-08 11:50:19 -07:00
fsl_booke_mmu.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
hash_low_32.S [POWERPC] Fix 32-bit mm operations when not using BATs 2007-04-13 04:09:39 +10:00
hash_low_64.S [POWERPC] Allow drivers to map individual 4k pages to userspace 2007-04-13 03:55:18 +10:00
hash_native_64.c [POWERPC] 64K page support for kexec 2007-05-07 20:31:12 +10:00
hash_utils_64.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
hugetlbpage.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
imalloc.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
init_32.c [POWERPC] DEBUG_PAGEALLOC for 32-bit 2007-04-13 04:09:39 +10:00
init_64.c use SLAB_PANIC flag cleanup 2007-05-08 11:14:57 -07:00
lmb.c [POWERPC] Allow duplicate lmb_reserve() calls 2007-03-08 15:43:28 +11:00
Makefile [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
mem.c [POWERPC] Mark pages that don't exist as nosave 2007-05-09 16:34:56 +10:00
mmap.c
mmu_context_32.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mmu_context_64.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
mmu_decl.h [POWERPC] Revise PPC44x MMU code for arch/powerpc 2007-05-02 20:04:29 +10:00
numa.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
pgtable_32.c [POWERPC] Remove use of 4level-fixup.h for ppc32 2007-05-08 13:40:31 +10:00
pgtable_64.c [POWERPC] Fix bug with early ioremap and 64k pages 2007-02-16 14:00:20 +11:00
ppc_mmu_32.c [POWERPC] DEBUG_PAGEALLOC for 32-bit 2007-04-13 04:09:39 +10:00
slb.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
slb_low.S [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
slice.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
stab.c [POWERPC] Add __init annotations to reserve_mem() and stabs_alloc() 2007-05-08 11:54:19 +10:00
tlb_32.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
tlb_64.c [POWERPC] Make tlb flush batch use lazy MMU mode 2007-04-13 04:09:38 +10:00