linux/arch
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
..
alpha utimensat implementation 2007-05-08 11:15:18 -07:00
arm Add IRQF_IRQPOLL flag on arm 2007-05-08 11:15:22 -07:00
arm26 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
avr32 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
blackfin blackfin architecture 2007-05-07 12:12:58 -07:00
cris dma_declare_coherent_memory wrong allocation 2007-05-08 11:15:14 -07:00
frv FRV: Miscellaneous fixes 2007-05-08 20:41:14 -07:00
h8300 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
i386 Revert "fbdev: ignore VESA modes if framebuffer is disabled" 2007-05-08 20:12:30 -07:00
ia64 Add IRQF_IRQPOLL flag on IA64 2007-05-08 11:15:22 -07:00
m32r header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
m68k header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
m68knommu header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
mips Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2007-05-08 11:57:17 -07:00
parisc Add IRQF_IRQPOLL flag on parisc 2007-05-08 11:15:22 -07:00
powerpc [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
ppc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-05-08 11:50:19 -07:00
s390 no longer #include <asm/kdebug.h> 2007-05-08 11:15:20 -07:00
sh Add IRQF_IRQPOLL flag on sh 2007-05-08 11:15:22 -07:00
sh64 Simplify kallsyms_lookup() 2007-05-08 11:15:08 -07:00
sparc [SPARC]: Wire up utimensat syscall. 2007-05-08 17:50:14 -07:00
sparc64 [SPARC64]: Optimize fault kprobe handling just like powerpc. 2007-05-08 18:25:14 -07:00
um uml: pcap devices should get MACs from command line 2007-05-08 11:15:20 -07:00
v850 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
x86_64 x86, serial: convert legacy COM ports to platform devices 2007-05-08 11:15:23 -07:00
xtensa header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00