From: Matt Mackall <mpm@selenic.com>
To: Pekka J Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@sgi.com>, Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Hugh Dickins <hugh@veritas.com>, Andi Kleen <andi@firstfloor.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] procfs: provide slub's /proc/slabinfo
Date: Mon, 07 Jan 2008 13:03:15 -0600 [thread overview]
Message-ID: <1199732595.4110.30.camel@cinder.waste.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0801072005380.23932@sbz-30.cs.Helsinki.FI>
On Mon, 2008-01-07 at 20:06 +0200, Pekka J Enberg wrote:
> Hi Matt,
>
> On Sun, 6 Jan 2008, Matt Mackall wrote:
> > I don't have any particular "terrible" workloads for SLUB. But my
> > attempts to simply boot with all three allocators to init=/bin/bash in,
> > say, lguest show a fair margin for SLOB.
>
> Sorry, I once again have bad news ;-). I did some testing with
>
> lguest --block=<rootfile> 32 /boot/vmlinuz-2.6.24-rc6 root=/dev/vda init=doit
>
> where rootfile is
>
> http://uml.nagafix.co.uk/BusyBox-1.5.0/BusyBox-1.5.0-x86-root_fs.bz2
>
> and the "doit" script in the guest passed as init= is just
>
> #!/bin/sh
> mount -t proc proc /proc
> cat /proc/meminfo | grep MemTotal
> cat /proc/meminfo | grep MemFree
> cat /proc/meminfo | grep Slab
>
> and the results are:
>
> [ the minimum, maximum, and average are of captured from 10 individual runs ]
>
> Free (kB) Used (kB)
> Total (kB) min max average min max average
> SLUB (no debug) 26536 23868 23892 23877.6 2644 2668 2658.4
> SLOB 26548 23472 23640 23579.6 2908 3076 2968.4
> SLAB (no debug) 26544 23316 23364 23343.2 3180 3228 3200.8
> SLUB (with debug) 26484 23120 23136 23127.2 3348 3364 3356.8
>
> So it seems that on average SLUB uses 300 kilobytes *less memory* (!) (which is
> roughly 1% of total memory available) after boot than SLOB for my
> configuration.
Fascinating. Which kernel version are you using? This patch doesn't seem
to have made it to mainline:
---
slob: fix free block merging at head of subpage
We weren't merging freed blocks at the beginning of the free list.
Fixing this showed a 2.5% efficiency improvement in a userspace test
harness.
Signed-off-by: Matt Mackall <mpm@selenic.com>
diff -r 5374012889d6 mm/slob.c
--- a/mm/slob.c Wed Dec 05 09:27:46 2007 -0800
+++ b/mm/slob.c Wed Dec 05 16:10:37 2007 -0600
@@ -398,6 +398,10 @@ static void slob_free(void *block, int s
sp->units += units;
if (b < sp->free) {
+ if (b + units == sp->free) {
+ units += slob_units(sp->free);
+ sp->free = slob_next(sp->free);
+ }
set_slob(b, units, sp->free);
sp->free = b;
} else {
---
> One possible explanation is that the high internal fragmentation (space
> allocated but not used) of SLUB kmalloc() only affects short-lived allocations
> and thus does not show up in the more permanent memory footprint. Likewise, it
> could be that SLOB has higher external fragmentation (small blocks that are
> unavailable for allocation) of which SLUB does not suffer from. Dunno, haven't
> investigated as my results are contradictory to yours.
I suppose that's possible.
> I am beginning to think this is highly dependent on .config so would you mind
> sending me one you're using for testing, Matt?
I'm sure I don't have it any more, as that was back in July or so. How
about you send me your config and I'll try to figure out what's going
on?
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2008-01-07 19:04 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 18:43 Hugh Dickins
2008-01-02 18:53 ` Christoph Lameter
2008-01-02 19:09 ` Pekka Enberg
2008-01-02 19:35 ` Linus Torvalds
2008-01-02 19:45 ` Linus Torvalds
2008-01-02 19:49 ` Pekka Enberg
2008-01-02 22:50 ` Matt Mackall
2008-01-03 8:52 ` Ingo Molnar
2008-01-03 16:46 ` Matt Mackall
2008-01-04 2:21 ` Christoph Lameter
2008-01-04 2:45 ` Andi Kleen
2008-01-04 4:34 ` Matt Mackall
2008-01-04 9:17 ` Peter Zijlstra
2008-01-04 20:37 ` Christoph Lameter
2008-01-04 4:11 ` Matt Mackall
2008-01-04 20:34 ` Christoph Lameter
2008-01-04 20:55 ` Matt Mackall
2008-01-04 21:36 ` Christoph Lameter
2008-01-04 22:30 ` Matt Mackall
2008-01-05 20:16 ` Christoph Lameter
2008-01-05 16:21 ` Pekka J Enberg
2008-01-05 17:14 ` Andi Kleen
2008-01-05 20:05 ` Christoph Lameter
2008-01-07 20:12 ` Pekka J Enberg
2008-01-06 17:51 ` Matt Mackall
2008-01-07 18:06 ` Pekka J Enberg
2008-01-07 19:03 ` Matt Mackall [this message]
2008-01-07 19:53 ` Pekka J Enberg
2008-01-07 20:44 ` Pekka J Enberg
2008-01-10 10:04 ` Pekka J Enberg
2008-01-09 19:15 ` [RFC PATCH] greatly reduce SLOB external fragmentation Matt Mackall
2008-01-09 22:43 ` Pekka J Enberg
2008-01-09 22:59 ` Matt Mackall
2008-01-10 10:02 ` Pekka J Enberg
2008-01-10 10:54 ` Pekka J Enberg
2008-01-10 15:44 ` Matt Mackall
2008-01-10 16:13 ` Linus Torvalds
2008-01-10 17:49 ` Matt Mackall
2008-01-10 18:28 ` Linus Torvalds
2008-01-10 18:42 ` Matt Mackall
2008-01-10 19:24 ` Christoph Lameter
2008-01-10 19:44 ` Matt Mackall
2008-01-10 19:51 ` Christoph Lameter
2008-01-10 19:41 ` Linus Torvalds
2008-01-10 19:46 ` Christoph Lameter
2008-01-10 19:53 ` Andi Kleen
2008-01-10 19:52 ` Christoph Lameter
2008-01-10 19:16 ` Christoph Lameter
2008-01-10 19:23 ` Matt Mackall
2008-01-10 19:31 ` Christoph Lameter
2008-01-10 21:25 ` Jörn Engel
2008-01-10 18:13 ` Andi Kleen
2008-07-30 21:51 ` Pekka J Enberg
2008-07-30 22:00 ` Linus Torvalds
2008-07-30 22:22 ` Pekka Enberg
2008-07-30 22:35 ` Linus Torvalds
2008-07-31 0:42 ` malc
2008-07-31 1:03 ` Matt Mackall
2008-07-31 1:09 ` Matt Mackall
2008-07-31 14:11 ` Andi Kleen
2008-07-31 15:25 ` Christoph Lameter
2008-07-31 16:03 ` Andi Kleen
2008-07-31 16:05 ` Christoph Lameter
2008-07-31 14:26 ` Christoph Lameter
2008-07-31 15:38 ` Matt Mackall
2008-07-31 15:42 ` Christoph Lameter
2008-01-10 2:46 ` Matt Mackall
2008-01-10 10:03 ` Pekka J Enberg
2008-01-03 20:31 ` [PATCH] procfs: provide slub's /proc/slabinfo Christoph Lameter
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=1199732595.4110.30.camel@cinder.waste.org \
--to=mpm@selenic.com \
--cc=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=torvalds@linux-foundation.org \
/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
Powered by JetHome