linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Abel Wu <wuyun.wu@huawei.com>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	 Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	hewenliang4@huawei.com,  hushiyuan@huawei.com,
	"open list:SLAB ALLOCATOR" <linux-mm@kvack.org>,
	 open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/slub: fix missing ALLOC_SLOWPATH stat when bulk alloc
Date: Tue, 11 Aug 2020 14:40:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.23.453.2008111435300.3428139@chino.kir.corp.google.com> (raw)
In-Reply-To: <20200811022427.1363-1-wuyun.wu@huawei.com>

On Tue, 11 Aug 2020, wuyun.wu@huawei.com wrote:

> From: Abel Wu <wuyun.wu@huawei.com>
> 
> The ALLOC_SLOWPATH statistics is missing in bulk allocation now.
> Fix it by doing statistics in alloc slow path.
> 
> Signed-off-by: Abel Wu <wuyun.wu@huawei.com>
> ---
>  mm/slub.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index df93a5a0e9a4..5d89e4064f83 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2600,6 +2600,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) {
>  		/*
> @@ -2788,7 +2790,6 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s,
>  	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);
>  

Acked-by: David Rientjes <rientjes@google.com>

> -- 
> 2.28.0.windows.1

Lol :)


      parent reply	other threads:[~2020-08-11 21:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  2:24 wuyun.wu
2020-08-11  6:50 ` Pekka Enberg
2020-08-11 21:40 ` David Rientjes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.23.453.2008111435300.3428139@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hewenliang4@huawei.com \
    --cc=hushiyuan@huawei.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=wuyun.wu@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox