memblock: Introduce default allocation limit and use it to replace explicit ones
This introduce memblock.current_limit which is used to limit allocations
from memblock_alloc() or memblock_alloc_base(..., MEMBLOCK_ALLOC_ACCESSIBLE).
The old MEMBLOCK_ALLOC_ANYWHERE changes value from 0 to ~(u64)0 and can still
be used with memblock_alloc_base() to allocate really anywhere.
It is -no-longer- cropped to MEMBLOCK_REAL_LIMIT which disappears.
Note to archs: I'm leaving the default limit to MEMBLOCK_ALLOC_ANYWHERE. I
strongly recommend that you ensure that you set an appropriate limit
during boot in order to guarantee that an memblock_alloc() at any time
results in something that is accessible with a simple __va().
The reason is that a subsequent patch will introduce the ability for
the array to resize itself by reallocating itself. The MEMBLOCK core will
honor the current limit when performing those allocations.
Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing
- arch/microblaze/include/asm/memblock.h 0 additions, 3 deletionsarch/microblaze/include/asm/memblock.h
- arch/powerpc/include/asm/memblock.h 0 additions, 7 deletionsarch/powerpc/include/asm/memblock.h
- arch/powerpc/kernel/prom.c 19 additions, 1 deletionarch/powerpc/kernel/prom.c
- arch/powerpc/kernel/setup_32.c 1 addition, 1 deletionarch/powerpc/kernel/setup_32.c
- arch/powerpc/mm/40x_mmu.c 3 additions, 2 deletionsarch/powerpc/mm/40x_mmu.c
- arch/powerpc/mm/fsl_booke_mmu.c 2 additions, 1 deletionarch/powerpc/mm/fsl_booke_mmu.c
- arch/powerpc/mm/hash_utils_64.c 2 additions, 1 deletionarch/powerpc/mm/hash_utils_64.c
- arch/powerpc/mm/init_32.c 7 additions, 22 deletionsarch/powerpc/mm/init_32.c
- arch/powerpc/mm/ppc_mmu_32.c 1 addition, 2 deletionsarch/powerpc/mm/ppc_mmu_32.c
- arch/powerpc/mm/tlb_nohash.c 2 additions, 0 deletionsarch/powerpc/mm/tlb_nohash.c
- arch/sh/include/asm/memblock.h 0 additions, 2 deletionsarch/sh/include/asm/memblock.h
- arch/sparc/include/asm/memblock.h 0 additions, 2 deletionsarch/sparc/include/asm/memblock.h
- include/linux/memblock.h 15 additions, 1 deletioninclude/linux/memblock.h
- mm/memblock.c 11 additions, 8 deletionsmm/memblock.c
Loading
Please register or sign in to comment