Thread (77 messages) 77 messages, 3 authors, 2021-10-14
STALE1745d

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

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Date: 2021-10-04 13:54:11
Subsystem: memory management, slab allocator, the rest · Maintainers: Andrew Morton, Vlastimil Babka, Harry Yoo, Linus Torvalds

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 --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;
-- 
2.32.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help