Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa817f0 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

Slab allocators: define common size limitations



Currently we have a maze of configuration variables that determine the
maximum slab size.  Worst of all it seems to vary between SLAB and SLUB.

So define a common maximum size for kmalloc.  For conveniences sake we use
the maximum size ever supported which is 32 MB.  We limit the maximum size
to a lower limit if MAX_ORDER does not allow such large allocations.

For many architectures this patch will have the effect of adding large
kmalloc sizes.  x86_64 adds 5 new kmalloc sizes.  So a small amount of
memory will be needed for these caches (contemporary SLAB has dynamically
sizeable node and cpu structure so the waste is less than in the past)

Most architectures will then be able to allocate object with sizes up to
MAX_ORDER.  We have had repeated breakage (in fact whenever we doubled the
number of supported processors) on IA64 because one or the other struct
grew beyond what the slab allocators supported.  This will avoid future
issues and f.e.  avoid fixes for 2k and 4k cpu support.

CONFIG_LARGE_ALLOCS is no longer necessary so drop it.

It fixes sparc64 with SLAB.

Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatar"David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3ec09742
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -560,14 +560,6 @@ endchoice


source "mm/Kconfig"
source "mm/Kconfig"


config LARGE_ALLOCS
	bool "Allow allocating large blocks (> 1MB) of memory"
	help
	  Allow the slab memory allocator to keep chains for very large
	  memory sizes - upto 32MB. You may need this if your system has
	  a lot of RAM, and you need to able to allocate very large
	  contiguous chunks. If unsure, say N.

config BFIN_DMA_5XX
config BFIN_DMA_5XX
	bool "Enable DMA Support"
	bool "Enable DMA Support"
	depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561)
	depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561)
+0 −8
Original line number Original line Diff line number Diff line
@@ -102,14 +102,6 @@ config HIGHPTE
	  with a lot of RAM, this can be wasteful of precious low memory.
	  with a lot of RAM, this can be wasteful of precious low memory.
	  Setting this option will put user-space page tables in high memory.
	  Setting this option will put user-space page tables in high memory.


config LARGE_ALLOCS
	bool "Allow allocating large blocks (> 1MB) of memory"
	help
	  Allow the slab memory allocator to keep chains for very large memory
	  sizes - up to 32MB. You may need this if your system has a lot of
	  RAM, and you need to able to allocate very large contiguous chunks.
	  If unsure, say N.

source "mm/Kconfig"
source "mm/Kconfig"


choice
choice
+0 −8
Original line number Original line Diff line number Diff line
@@ -470,14 +470,6 @@ config AVNET
	default y
	default y
	depends on (AVNET5282)
	depends on (AVNET5282)


config LARGE_ALLOCS
	bool "Allow allocating large blocks (> 1MB) of memory"
	help
	  Allow the slab memory allocator to keep chains for very large
	  memory sizes - upto 32MB. You may need this if your system has
	  a lot of RAM, and you need to able to allocate very large
	  contiguous chunks. If unsure, say N.

config 4KSTACKS
config 4KSTACKS
	bool "Use 4Kb for kernel stacks instead of 8Kb"
	bool "Use 4Kb for kernel stacks instead of 8Kb"
	default y
	default y
+0 −8
Original line number Original line Diff line number Diff line
@@ -240,14 +240,6 @@ menu "Processor type and features"
   config RESET_GUARD
   config RESET_GUARD
   	  bool "Reset Guard"
   	  bool "Reset Guard"


   config LARGE_ALLOCS
	  bool "Allow allocating large blocks (> 1MB) of memory"
	  help
	     Allow the slab memory allocator to keep chains for very large
	     memory sizes - upto 32MB. You may need this if your system has
	     a lot of RAM, and you need to able to allocate very large
	     contiguous chunks. If unsure, say N.

source "mm/Kconfig"
source "mm/Kconfig"


endmenu
endmenu
+15 −5
Original line number Original line Diff line number Diff line
@@ -19,17 +19,27 @@
	CACHE(32768)
	CACHE(32768)
	CACHE(65536)
	CACHE(65536)
	CACHE(131072)
	CACHE(131072)
#if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU)
#if KMALLOC_MAX_SIZE >= 262144
	CACHE(262144)
	CACHE(262144)
#endif
#endif
#ifndef CONFIG_MMU
#if KMALLOC_MAX_SIZE >= 524288
	CACHE(524288)
	CACHE(524288)
#endif
#if KMALLOC_MAX_SIZE >= 1048576
	CACHE(1048576)
	CACHE(1048576)
#ifdef CONFIG_LARGE_ALLOCS
#endif
#if KMALLOC_MAX_SIZE >= 2097152
	CACHE(2097152)
	CACHE(2097152)
#endif
#if KMALLOC_MAX_SIZE >= 4194304
	CACHE(4194304)
	CACHE(4194304)
#endif
#if KMALLOC_MAX_SIZE >= 8388608
	CACHE(8388608)
	CACHE(8388608)
#endif
#if KMALLOC_MAX_SIZE >= 16777216
	CACHE(16777216)
	CACHE(16777216)
#endif
#if KMALLOC_MAX_SIZE >= 33554432
	CACHE(33554432)
	CACHE(33554432)
#endif /* CONFIG_LARGE_ALLOCS */
#endif
#endif /* CONFIG_MMU */
Loading