diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-11 08:23:19 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-11 12:03:30 -0400 |
commit | dbb1f81ca67a56c6cfce4c94d07c76378fd4af9e (patch) | |
tree | a3a973f1790713fea944b293bb439c7fe84ea1ab /mm/page_alloc.c | |
parent | 89219d37a2377c44fde7bff0bf0623453c05329a (diff) |
kmemleak: Add kmemleak_alloc callback from alloc_large_system_hash
The alloc_large_system_hash function is called from various places in
the kernel and it contains pointers to other allocated structures. It
therefore needs to be traced by kmemleak.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 474c7e9dd51a..17d5f539a9aa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/page-isolation.h> | 46 | #include <linux/page-isolation.h> |
47 | #include <linux/page_cgroup.h> | 47 | #include <linux/page_cgroup.h> |
48 | #include <linux/debugobjects.h> | 48 | #include <linux/debugobjects.h> |
49 | #include <linux/kmemleak.h> | ||
49 | 50 | ||
50 | #include <asm/tlbflush.h> | 51 | #include <asm/tlbflush.h> |
51 | #include <asm/div64.h> | 52 | #include <asm/div64.h> |
@@ -4546,6 +4547,16 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
4546 | if (_hash_mask) | 4547 | if (_hash_mask) |
4547 | *_hash_mask = (1 << log2qty) - 1; | 4548 | *_hash_mask = (1 << log2qty) - 1; |
4548 | 4549 | ||
4550 | /* | ||
4551 | * If hashdist is set, the table allocation is done with __vmalloc() | ||
4552 | * which invokes the kmemleak_alloc() callback. This function may also | ||
4553 | * be called before the slab and kmemleak are initialised when | ||
4554 | * kmemleak simply buffers the request to be executed later | ||
4555 | * (GFP_ATOMIC flag ignored in this case). | ||
4556 | */ | ||
4557 | if (!hashdist) | ||
4558 | kmemleak_alloc(table, size, 1, GFP_ATOMIC); | ||
4559 | |||
4549 | return table; | 4560 | return table; |
4550 | } | 4561 | } |
4551 | 4562 | ||