]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - mm/kmemleak.c
mm: kmemleak: simple memory allocation pool for kmemleak objects
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 23 Sep 2019 22:34:02 +0000 (15:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Sep 2019 22:54:07 +0000 (15:54 -0700)
commit0647398a8c7bd55e0b7565c5076e86b7c3c204c5
tree6613297ab1c94ffc0bfb60d810592d1d61b48319
parentdba82d9431770e68c45b03f0ffa2daa8abfb9429
mm: kmemleak: simple memory allocation pool for kmemleak objects

Add a memory pool for struct kmemleak_object in case the normal
kmem_cache_alloc() fails under the gfp constraints passed by the caller.
The mem_pool[] array size is currently fixed at 16000.

We are not using the existing mempool kernel API since this requires
the slab allocator to be available (for pool->elements allocation).  A
subsequent kmemleak patch will replace the static early log buffer with
the pool allocation introduced here and this functionality is required
to be available before the slab was initialised.

Link: http://lkml.kernel.org/r/20190812160642.52134-3-catalin.marinas@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qian Cai <cai@lca.pw>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/kmemleak.c