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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1009141646350.26982@chino.kir.corp.google.com>
Date:	Tue, 14 Sep 2010 17:02:39 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Pekka Enberg <penberg@...nel.org>
cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Christoph Lameter <cl@...ux.com>
Subject: Re: [PATCH v2 2/2] SLUB: Mark merged slab caches in /proc/slabinfo

On Wed, 15 Sep 2010, Pekka Enberg wrote:

> > > In my not-so-humble opinion, either the merging needs to go away
> > > entirely, or the misleading output needs to be fixed.
> > Cache merging may have been advertised as a bigger performance improvement
> > than it actually is, and I don't do it in my own slab allocator for other
> > reasons, but it does lead to more effective memory use by reducing slab
> > fragmentation.  On one of my benchmarking servers, over 60% of caches are
> > merged and /sys/kernel/slab/.../partial reports roughly the same percent
> > of fewer total partial slabs over the system in comparison to
> > slub_nomerge.
> Last time I checked (and it's been a while), it did reduce _internal
> fragmentation_ for the naive "memory used after boot" scenario. I don't think
> I ever advertised it as a performance improvement. Dunno if somebody else did.
> 

I believe that cache merging was advertised as being both a small 
cacheline optimization and a method for reducing slab fragmentation by 
filling up partial slabs.  Regardless, I measured the latter to be much 
more significant and found only a very slight improvement for netperf 
TCP_RR on machines with large cpu counts in comparison to slub_nomerge.

I don't believe that we need to remove cache merging and allocate more 
memory by default to be able to identify a particular cache using an 
egregious amount of slab when troubleshooting a problem.  That amount of 
memory (probably 4-8MB) is significant without kmem_cache_shrink() since, 
using my example where 60% of caches were merged into others, the partial 
list won't shrink below min_partial slabs for those ~120 caches.

I prefer my suggestion of using the unique ids of each cache in 
/proc/slabinfo since it won't unfairly attribute slab to caches that 
didn't allocate it.  Sure, /proc/slabinfo can't tell you which cache is at 
fault without booting with slub_nomerge, enabling tracing, using 
SLAB_TRACE, or kmemleak, but I think that's better than sacrificing the 
slab fragmentation by default.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ