All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <songmuchun@bytedance.com>
To: David Rientjes <rientjes@google.com>
Cc: cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com,
	akpm@linux-foundation.org, vbabka@suse.cz,
	roman.gushchin@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, smuchun@gmail.com
Subject: Re: [PATCH] mm: slab: optimize memcg_slab_free_hook()
Date: Tue, 26 Apr 2022 17:25:40 +0800	[thread overview]
Message-ID: <Yme6lFrVj8FHegjN@FVFYT0MHHV2J.usts.net> (raw)
In-Reply-To: <74f6b949-f9f-deb1-2786-47c92a619fd8@google.com>

On Mon, Apr 25, 2022 at 12:42:23PM -0700, David Rientjes wrote:
> On Mon, 25 Apr 2022, Muchun Song wrote:
> 
> > Most callers of memcg_slab_free_hook() already know the slab,  which could
> > be passed to memcg_slab_free_hook() directly to reduce the overhead of an
> > another call of virt_to_slab().  For bulk freeing of objects, the call of
> > slab_objcgs() in the loop in memcg_slab_free_hook() is redundant as well.
> > Rework memcg_slab_free_hook() and build_detached_freelist() to reduce
> > those unnecessary overhead and make memcg_slab_free_hook() can handle bulk
> > freeing in slab_free().
> > 
> 
> I agree that for the SLUB case the code flows better after this, but I'm 
> wondering if you have any numbers to share on how much better this is once 
> we've avoided the virt_to_slab() calls?
> 
> IOW, I'm struggling to figure out if this is code cleanup or a performance 
> optimization.
>

I think it is both. The numbers are listed in another thread [1].

[1] https://lore.kernel.org/linux-mm/Yme5zE8ZU%2FFN63Av@FVFYT0MHHV2J.usts.net/T/#m7e5c4ae3e92128781664b3396ce300c8076a5b63

Thanks.
 

  reply	other threads:[~2022-04-26 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  3:54 [PATCH] mm: slab: optimize memcg_slab_free_hook() Muchun Song
2022-04-25 19:42 ` David Rientjes
2022-04-26  9:25   ` Muchun Song [this message]
2022-04-26  2:27 ` Roman Gushchin
2022-04-26  9:22   ` Muchun Song

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=Yme6lFrVj8FHegjN@FVFYT0MHHV2J.usts.net \
    --to=songmuchun@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=smuchun@gmail.com \
    --cc=vbabka@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.