Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155350
b: refs/heads/master
c: e4f7c0b
h: refs/heads/master
v: v3
  • Loading branch information
Catalin Marinas committed Jul 8, 2009
1 parent 43d77de commit 7e0e19e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2587362eaf5c9df4e08de11e6340e3c4a88ed4c8
refs/heads/master: e4f7c0b44a8ac8935f223195af9ea637d0c08091
2 changes: 2 additions & 0 deletions trunk/include/linux/slub_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/workqueue.h>
#include <linux/kobject.h>
#include <linux/kmemtrace.h>
#include <linux/kmemleak.h>

enum stat_item {
ALLOC_FASTPATH, /* Allocation from cpu slab */
Expand Down Expand Up @@ -233,6 +234,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
unsigned int order = get_order(size);
void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order);

kmemleak_alloc(ret, size, 1, flags);
trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags);

return ret;
Expand Down
10 changes: 6 additions & 4 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/kmemcheck.h>
#include <linux/cpu.h>
#include <linux/cpuset.h>
#include <linux/kmemleak.h>
#include <linux/mempolicy.h>
#include <linux/ctype.h>
#include <linux/debugobjects.h>
Expand Down Expand Up @@ -2835,13 +2834,15 @@ EXPORT_SYMBOL(__kmalloc);
static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
{
struct page *page;
void *ptr = NULL;

flags |= __GFP_COMP | __GFP_NOTRACK;
page = alloc_pages_node(node, flags, get_order(size));
if (page)
return page_address(page);
else
return NULL;
ptr = page_address(page);

kmemleak_alloc(ptr, size, 1, flags);
return ptr;
}

#ifdef CONFIG_NUMA
Expand Down Expand Up @@ -2926,6 +2927,7 @@ void kfree(const void *x)
page = virt_to_head_page(x);
if (unlikely(!PageSlab(page))) {
BUG_ON(!PageCompound(page));
kmemleak_free(x);
put_page(page);
return;
}
Expand Down

0 comments on commit 7e0e19e

Please sign in to comment.