From: Qian Cai <cai@xxxxxx> Subject: mm/kmemleak.c: record the current memory pool size The only way to obtain the current memory pool size for a running kernel is to check the kernel config file which is inconvenient. Record it in the kernel messages. [akpm@xxxxxxxxxxxxxxxxxxxx: s/memory pool size/memory pool/available/, per Catalin] Link: http://lkml.kernel.org/r/1565809631-28933-1-git-send-email-cai@xxxxxx Signed-off-by: Qian Cai <cai@xxxxxx> Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/kmemleak.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/kmemleak.c~mm-kmemleak-record-the-current-memory-pool-size +++ a/mm/kmemleak.c @@ -1967,7 +1967,8 @@ static int __init kmemleak_late_init(voi mutex_unlock(&scan_mutex); } - pr_info("Kernel memory leak detector initialized\n"); + pr_info("Kernel memory leak detector initialized (mem pool available: %d)\n", + mem_pool_free_count); return 0; } _