Skip to content

Commit

Permalink
mm, slab: moved kmem_cache_alloc_node comment to correct place
Browse files Browse the repository at this point in the history
After several fixing about kmem_cache_alloc_node(), its comment
was splitted. This patch moved it on top of kmem_cache_alloc_node()
definition.

Signed-off-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Zhouping Liu authored and Pekka Enberg committed Jun 8, 2013
1 parent 8a965b3 commit d0d04b7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -3340,18 +3340,6 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags,
return obj;
}

/**
* kmem_cache_alloc_node - Allocate an object on the specified node
* @cachep: The cache to allocate from.
* @flags: See kmalloc().
* @nodeid: node number of the target node.
* @caller: return address of caller, used for debug information
*
* Identical to kmem_cache_alloc but it will allocate memory on the given
* node, which can improve the performance for cpu bound structures.
*
* Fallback to other node is possible if __GFP_THISNODE is not set.
*/
static __always_inline void *
slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
unsigned long caller)
Expand Down Expand Up @@ -3645,6 +3633,17 @@ EXPORT_SYMBOL(kmem_cache_alloc_trace);
#endif

#ifdef CONFIG_NUMA
/**
* kmem_cache_alloc_node - Allocate an object on the specified node
* @cachep: The cache to allocate from.
* @flags: See kmalloc().
* @nodeid: node number of the target node.
*
* Identical to kmem_cache_alloc but it will allocate memory on the given
* node, which can improve the performance for cpu bound structures.
*
* Fallback to other node is possible if __GFP_THISNODE is not set.
*/
void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
{
void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_);
Expand Down

0 comments on commit d0d04b7

Please sign in to comment.