lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yme6lFrVj8FHegjN@FVFYT0MHHV2J.usts.net>
Date:   Tue, 26 Apr 2022 17:25:40 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     David Rientjes <rientjes@...gle.com>
Cc:     cl@...ux.com, penberg@...nel.org, iamjoonsoo.kim@....com,
        akpm@...ux-foundation.org, vbabka@...e.cz,
        roman.gushchin@...ux.dev, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, smuchun@...il.com
Subject: Re: [PATCH] mm: slab: optimize memcg_slab_free_hook()

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.
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ