aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 307bfbe62387..1d9abb7d22a0 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -116,7 +116,9 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
116 unsigned long, 116 unsigned long,
117 void (*)(void *)); 117 void (*)(void *));
118#ifdef CONFIG_MEMCG_KMEM 118#ifdef CONFIG_MEMCG_KMEM
119void kmem_cache_create_memcg(struct mem_cgroup *, struct kmem_cache *); 119struct kmem_cache *memcg_create_kmem_cache(struct mem_cgroup *,
120 struct kmem_cache *,
121 const char *);
120#endif 122#endif
121void kmem_cache_destroy(struct kmem_cache *); 123void kmem_cache_destroy(struct kmem_cache *);
122int kmem_cache_shrink(struct kmem_cache *); 124int kmem_cache_shrink(struct kmem_cache *);
@@ -369,16 +371,7 @@ kmem_cache_alloc_node_trace(struct kmem_cache *s,
369#include <linux/slub_def.h> 371#include <linux/slub_def.h>
370#endif 372#endif
371 373
372static __always_inline void * 374extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order);
373kmalloc_order(size_t size, gfp_t flags, unsigned int order)
374{
375 void *ret;
376
377 flags |= (__GFP_COMP | __GFP_KMEMCG);
378 ret = (void *) __get_free_pages(flags, order);
379 kmemleak_alloc(ret, size, 1, flags);
380 return ret;
381}
382 375
383#ifdef CONFIG_TRACING 376#ifdef CONFIG_TRACING
384extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order); 377extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order);
@@ -533,10 +526,7 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
533 * @memcg: pointer to the memcg this cache belongs to 526 * @memcg: pointer to the memcg this cache belongs to
534 * @list: list_head for the list of all caches in this memcg 527 * @list: list_head for the list of all caches in this memcg
535 * @root_cache: pointer to the global, root cache, this cache was derived from 528 * @root_cache: pointer to the global, root cache, this cache was derived from
536 * @dead: set to true after the memcg dies; the cache may still be around.
537 * @nr_pages: number of pages that belongs to this cache. 529 * @nr_pages: number of pages that belongs to this cache.
538 * @destroy: worker to be called whenever we are ready, or believe we may be
539 * ready, to destroy this cache.
540 */ 530 */
541struct memcg_cache_params { 531struct memcg_cache_params {
542 bool is_root_cache; 532 bool is_root_cache;
@@ -549,9 +539,7 @@ struct memcg_cache_params {
549 struct mem_cgroup *memcg; 539 struct mem_cgroup *memcg;
550 struct list_head list; 540 struct list_head list;
551 struct kmem_cache *root_cache; 541 struct kmem_cache *root_cache;
552 bool dead;
553 atomic_t nr_pages; 542 atomic_t nr_pages;
554 struct work_struct destroy;
555 }; 543 };
556 }; 544 };
557}; 545};