From: Abel Wu Date: Tue, 13 Oct 2020 23:48:43 +0000 (-0700) Subject: mm/slub: fix missing ALLOC_SLOWPATH stat when bulk alloc X-Git-Tag: v5.10.7~1450^2~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f986d998a3001b6eeb189be8444bc0360e61e24;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Andrew Morton Reviewed-by: Pekka Enberg Acked-by: David Rientjes Cc: Christoph Lameter Cc: Joonsoo Kim Cc: Hewenliang Cc: Hu Shiyuan Link: http://lkml.kernel.org/r/20200811022427.1363-1-wuyun.wu@huawei.com Signed-off-by: Linus Torvalds --- diff --git a/mm/slub.c b/mm/slub.c index da6438b..7728a0b 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);