aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-06-11 08:22:39 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2009-06-11 12:03:28 -0400
commit3c7b4e6b8be4c16f1e6e5c558e33b7ff0db2dfaf (patch)
tree3722fc5220bf8d611def5618758b05160ff05312 /init/main.c
parent991ec02cdca33b03a132a0cacfe6f0aa0be9aa8d (diff)
kmemleak: Add the base support
This patch adds the base support for the kernel memory leak detector. It traces the memory allocation/freeing in a way similar to the Boehm's conservative garbage collector, the difference being that the unreferenced objects are not freed but only shown in /sys/kernel/debug/kmemleak. Enabling this feature introduces an overhead to memory allocations. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Ingo Molnar <mingo@elte.hu> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index bb7dc57eee36..9d759d68d7a0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -56,6 +56,7 @@
56#include <linux/debug_locks.h> 56#include <linux/debug_locks.h>
57#include <linux/debugobjects.h> 57#include <linux/debugobjects.h>
58#include <linux/lockdep.h> 58#include <linux/lockdep.h>
59#include <linux/kmemleak.h>
59#include <linux/pid_namespace.h> 60#include <linux/pid_namespace.h>
60#include <linux/device.h> 61#include <linux/device.h>
61#include <linux/kthread.h> 62#include <linux/kthread.h>
@@ -603,6 +604,7 @@ asmlinkage void __init start_kernel(void)
603 /* init some links before init_ISA_irqs() */ 604 /* init some links before init_ISA_irqs() */
604 early_irq_init(); 605 early_irq_init();
605 init_IRQ(); 606 init_IRQ();
607 prio_tree_init();
606 pidhash_init(); 608 pidhash_init();
607 init_timers(); 609 init_timers();
608 hrtimers_init(); 610 hrtimers_init();
@@ -654,6 +656,7 @@ asmlinkage void __init start_kernel(void)
654 cpu_hotplug_init(); 656 cpu_hotplug_init();
655 kmem_cache_init(); 657 kmem_cache_init();
656 kmemtrace_init(); 658 kmemtrace_init();
659 kmemleak_init();
657 debug_objects_mem_init(); 660 debug_objects_mem_init();
658 idr_init_cache(); 661 idr_init_cache();
659 setup_per_cpu_pageset(); 662 setup_per_cpu_pageset();
@@ -663,7 +666,6 @@ asmlinkage void __init start_kernel(void)
663 calibrate_delay(); 666 calibrate_delay();
664 pidmap_init(); 667 pidmap_init();
665 pgtable_cache_init(); 668 pgtable_cache_init();
666 prio_tree_init();
667 anon_vma_init(); 669 anon_vma_init();
668#ifdef CONFIG_X86 670#ifdef CONFIG_X86
669 if (efi_enabled) 671 if (efi_enabled)