aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbel Wu <[email protected]>2020-10-13 16:48:43 -0700
committerLinus Torvalds <[email protected]>2020-10-13 18:38:27 -0700
commit9f986d998a3001b6eeb189be8444bc0360e61e24 (patch)
tree51a1a364958d941d87d2e2c2d4afcd03af2c4d75
parentc270cf3041a5cb7c5853d45a794309e66576493a (diff)
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]>
-rw-r--r--mm/slub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index da6438bd8202..7728a0b71d63 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2661,6 +2661,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
void *freelist;
struct page *page;
+ stat(s, ALLOC_SLOWPATH);
+
page = c->page;
if (!page) {
/*
@@ -2850,7 +2852,6 @@ redo:
page = c->page;
if (unlikely(!object || !node_match(page, node))) {
object = __slab_alloc(s, gfpflags, node, addr, c);
- stat(s, ALLOC_SLOWPATH);
} else {
void *next_object = get_freepointer_safe(s, object);