Skip to content

Commit 9f986d9

Browse files
Abel Wutorvalds
authored andcommitted
mm/slub: fix missing ALLOC_SLOWPATH stat when bulk alloc
The ALLOC_SLOWPATH statistics is missing in bulk allocation now. Fix it by doing statistics in alloc slow path. Signed-off-by: Abel Wu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Pekka Enberg <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Hewenliang <[email protected]> Cc: Hu Shiyuan <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent c270cf3 commit 9f986d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/slub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
26612661
void *freelist;
26622662
struct page *page;
26632663

2664+
stat(s, ALLOC_SLOWPATH);
2665+
26642666
page = c->page;
26652667
if (!page) {
26662668
/*
@@ -2850,7 +2852,6 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s,
28502852
page = c->page;
28512853
if (unlikely(!object || !node_match(page, node))) {
28522854
object = __slab_alloc(s, gfpflags, node, addr, c);
2853-
stat(s, ALLOC_SLOWPATH);
28542855
} else {
28552856
void *next_object = get_freepointer_safe(s, object);
28562857

0 commit comments

Comments
 (0)