diff mbox series

[04/62] mm: Add account_slab() and unaccount_slab()

Message ID 20211004134650.4031813-5-willy@infradead.org (mailing list archive)
State New
Headers show
Series Separate struct slab from struct page | expand

Commit Message

Matthew Wilcox (Oracle) Oct. 4, 2021, 1:45 p.m. UTC
These functions simply call their page equivalents for now.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/slab.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/mm/slab.h b/mm/slab.h
index 54b05f4d9eb5..305cc8c7fed8 100644
--- 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;