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]
Date:	Sat, 5 Jan 2008 12:16:22 -0800 (PST)
From:	Christoph Lameter <clameter@....com>
To:	Matt Mackall <mpm@...enic.com>
cc:	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Hugh Dickins <hugh@...itas.com>,
	Andi Kleen <andi@...stfloor.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] procfs: provide slub's /proc/slabinfo

On Fri, 4 Jan 2008, Matt Mackall wrote:

> > SLUB 32	    (all memory of the 4k page is used for 128 byte objects)
> > SLAB 29/30  (management structure occupies first two/three objects)
> > SLOB 30(?)  (Alignment results in object being 136 byte of effective size,
> > 		we have 16 bytes leftover that could be used for a
> > 		very small allocation. Right?)
> 
> Don't know how you got to 136, the minimum alignment is 4 on x86. But I

Right I am thinking about 64 bit systems where the alignment is 8 bytes.

> already said in my last email that SLUB would win for the special case
> of power of two allocations. But as long as we're looking at worst
> cases, let's consider an alloc of 257 bytes..

Yup that hits it by forcing a rounding up to a size of 512 bytes because 
there is no intermediate cache size before 1024. The rounding up is 
a pretty weak spot in terms of memory use.

> SLUB  8 (1016 bytes wasted)
> SLOB 15 (105 bytes wasted, with 136 bytes still usable)

Well we can actually turn this around. What I gave was not actually the 
worst case for SLOB. The worst case is an 8 byte allocation where SLOB 
needs double the memory of SLUB.

SLUB 	512	(Nothing wasted)
SLOB 	256	(Half of the page wasted for metadata)
SLAB	119	(32 byte mininum alloc size + management struct needs)

But these are all extreme cases. Depends on the mix of allocs who wins and 
from what I can tell the avoiding of rounding up to a power of two gives 
SLOB a key advantage. If we would find the worst offenders there and use 
kmem_cache_alloc instead then we may be able to offset that advantage.



--
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