diff options
| -rw-r--r-- | mm/slab.c | 23 |
1 files changed, 11 insertions, 12 deletions
| @@ -3340,18 +3340,6 @@ done: | |||
| 3340 | return obj; | 3340 | return obj; |
| 3341 | } | 3341 | } |
| 3342 | 3342 | ||
| 3343 | /** | ||
| 3344 | * kmem_cache_alloc_node - Allocate an object on the specified node | ||
| 3345 | * @cachep: The cache to allocate from. | ||
| 3346 | * @flags: See kmalloc(). | ||
| 3347 | * @nodeid: node number of the target node. | ||
| 3348 | * @caller: return address of caller, used for debug information | ||
| 3349 | * | ||
| 3350 | * Identical to kmem_cache_alloc but it will allocate memory on the given | ||
| 3351 | * node, which can improve the performance for cpu bound structures. | ||
| 3352 | * | ||
| 3353 | * Fallback to other node is possible if __GFP_THISNODE is not set. | ||
| 3354 | */ | ||
| 3355 | static __always_inline void * | 3343 | static __always_inline void * |
| 3356 | slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, | 3344 | slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, |
| 3357 | unsigned long caller) | 3345 | unsigned long caller) |
| @@ -3645,6 +3633,17 @@ EXPORT_SYMBOL(kmem_cache_alloc_trace); | |||
| 3645 | #endif | 3633 | #endif |
| 3646 | 3634 | ||
| 3647 | #ifdef CONFIG_NUMA | 3635 | #ifdef CONFIG_NUMA |
| 3636 | /** | ||
| 3637 | * kmem_cache_alloc_node - Allocate an object on the specified node | ||
| 3638 | * @cachep: The cache to allocate from. | ||
| 3639 | * @flags: See kmalloc(). | ||
| 3640 | * @nodeid: node number of the target node. | ||
| 3641 | * | ||
| 3642 | * Identical to kmem_cache_alloc but it will allocate memory on the given | ||
| 3643 | * node, which can improve the performance for cpu bound structures. | ||
| 3644 | * | ||
| 3645 | * Fallback to other node is possible if __GFP_THISNODE is not set. | ||
| 3646 | */ | ||
| 3648 | void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid) | 3647 | void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid) |
| 3649 | { | 3648 | { |
| 3650 | void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_); | 3649 | void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_); |
