]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm: Add account_slab() and unaccount_slab()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Oct 2021 14:11:16 +0000 (10:11 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 03:06:36 +0000 (23:06 -0400)
These functions simply call their page equivalents for now.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/slab.h

index 54b05f4d9eb5bd512ee91364855b7c60d800ae54..305cc8c7fed8287198b9bfdc2d5cf0e8fb49eab3 100644 (file)
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -510,6 +510,18 @@ static __always_inline void unaccount_slab_page(struct page *page, int order,
                            -(PAGE_SIZE << order));
 }
 
+static __always_inline void account_slab(struct slab *slab, int order,
+                                        struct kmem_cache *s, gfp_t gfp)
+{
+       account_slab_page(slab_page(slab), order, s, gfp);
+}
+
+static __always_inline void unaccount_slab(struct slab *slab, int order,
+                                          struct kmem_cache *s)
+{
+       unaccount_slab_page(slab_page(slab), order, s);
+}
+
 static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
 {
        struct kmem_cache *cachep;