Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86686
b: refs/heads/master
c: f619cfe
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter committed Mar 3, 2008
1 parent aa72781 commit ed34739
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: 7693143481730686362cc6360e3d47c012d9b2c8
refs/heads/master: f619cfe1bda809a97c407f4c723eb3235ecd64e5
15 changes: 13 additions & 2 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2592,13 +2592,24 @@ void *__kmalloc(size_t size, gfp_t flags)
}
EXPORT_SYMBOL(__kmalloc);

static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
{
struct page *page = alloc_pages_node(node, flags | __GFP_COMP,
get_order(size));

if (page)
return page_address(page);
else
return NULL;
}

#ifdef CONFIG_NUMA
void *__kmalloc_node(size_t size, gfp_t flags, int node)
{
struct kmem_cache *s;

if (unlikely(size > PAGE_SIZE))
return kmalloc_large(size, flags);
return kmalloc_large_node(size, flags, node);

s = get_slab(size, flags);

Expand Down Expand Up @@ -3146,7 +3157,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
struct kmem_cache *s;

if (unlikely(size > PAGE_SIZE))
return kmalloc_large(size, gfpflags);
return kmalloc_large_node(size, gfpflags, node);

s = get_slab(size, gfpflags);

Expand Down

0 comments on commit ed34739

Please sign in to comment.