android_kernel_xiaomi_sm8350/include
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
..
acpi PNPACPI sets pnpdev->dev.archdata 2007-05-08 11:15:08 -07:00
asm-alpha Remove tas() 2007-05-08 11:15:20 -07:00
asm-arm Remove tas() 2007-05-08 11:15:20 -07:00
asm-arm26 Remove tas() 2007-05-08 11:15:20 -07:00
asm-avr32 Clean up mostly unused IOSPACE macros 2007-05-08 11:15:13 -07:00
asm-blackfin Remove tas() 2007-05-08 11:15:20 -07:00
asm-cris move die notifier handling to common code 2007-05-08 11:15:04 -07:00
asm-frv FRV: Miscellaneous fixes 2007-05-08 20:41:14 -07:00
asm-generic local_t: architecture independent extension 2007-05-08 11:15:20 -07:00
asm-h8300 Remove tas() 2007-05-08 11:15:20 -07:00
asm-i386 Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2007-05-08 12:07:28 -07:00
asm-ia64 local_t: ia64 extension 2007-05-08 11:15:20 -07:00
asm-m32r Remove tas() 2007-05-08 11:15:20 -07:00
asm-m68k m68k: <asm/scatterlist.h> needs <linux/types.h> 2007-05-08 20:41:14 -07:00
asm-m68knommu Remove tas() 2007-05-08 11:15:20 -07:00
asm-mips Remove tas() 2007-05-08 11:15:20 -07:00
asm-parisc local_t: parisc cleanup 2007-05-08 11:15:20 -07:00
asm-powerpc [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
asm-ppc Remove tas() 2007-05-08 11:15:20 -07:00
asm-s390 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
asm-sh Remove tas() 2007-05-08 11:15:20 -07:00
asm-sh64 Remove tas() 2007-05-08 11:15:20 -07:00
asm-sparc [SPARC]: Wire up utimensat syscall. 2007-05-08 17:50:14 -07:00
asm-sparc64 [SPARC64]: Optimize fault kprobe handling just like powerpc. 2007-05-08 18:25:14 -07:00
asm-um x86: create asm/cmpxchg.h 2007-05-08 11:15:20 -07:00
asm-v850 Remove tas() 2007-05-08 11:15:20 -07:00
asm-x86_64 Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2007-05-08 12:07:28 -07:00
asm-xtensa Remove tas() 2007-05-08 11:15:20 -07:00
crypto [CRYPTO] cryptd: Add software async crypto daemon 2007-05-02 14:38:32 +10:00
keys
linux [POWERPC] swsusp: Introduce register_nosave_region_late 2007-05-09 16:34:56 +10:00
math-emu Delete unused header file math-emu/extended.h 2007-05-08 11:15:05 -07:00
media i2c: Cleanup the includes of <linux/i2c.h> 2007-05-01 23:26:29 +02:00
mtd
net cleanup compat ioctl handling 2007-05-08 11:15:09 -07:00
pcmcia add new_id to PCMCIA drivers 2007-05-07 12:12:50 -07:00
rdma Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband 2007-05-07 12:18:21 -07:00
rxrpc
scsi [SCSI] sas_scsi_host: Convert to use the kthread API 2007-05-06 09:33:17 -05:00
sound
video atyfb: halve XCLK with Mobility and 32bit memory 2007-05-08 11:15:32 -07:00
Kbuild