From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: Christoph Lameter <clameter@sgi.com>
Cc: Mel Gorman <mel@csn.ul.ie>, Matt Mackall <mpm@selenic.com>,
linux-mm@kvack.org
Subject: Re: [patch 3/8] slub: Update statistics handling for variable order slabs
Date: Sat, 1 Mar 2008 12:29:44 +0200 [thread overview]
Message-ID: <84144f020803010229l7ad52a82o42a06d4de2bf6035@mail.gmail.com> (raw)
In-Reply-To: <20080229044818.999367120@sgi.com>
Hi Christoph,
On Fri, Feb 29, 2008 at 9:43 PM, Christoph Lameter <clameter@sgi.com> wrote:
> Hmmm... I get some weird numbers when I use slabinfo but cannot spot the
> issue. Could you look a bit closer at this? In particular at the slabinfo
> emulation?
What kind of weird numbers? Unfortunately the patch still looks
correct to me so it might be an integer overflow issue...
On Fri, Feb 29, 2008 at 6:48 AM, Christoph Lameter <clameter@sgi.com> wrote:
> @@ -4331,7 +4367,9 @@ static int s_show(struct seq_file *m, vo
> unsigned long nr_partials = 0;
nr_partials is no longer read so you can remove it.
> unsigned long nr_slabs = 0;
> unsigned long nr_inuse = 0;
No need to initialize nr_inuse to zero here.
> - unsigned long nr_objs;
> + unsigned long nr_objs = 0;
> + unsigned long nr_partial_inuse = 0;
> + unsigned long nr_partial_total = 0;
> struct kmem_cache *s;
> int node;
>
> @@ -4345,14 +4383,15 @@ static int s_show(struct seq_file *m, vo
>
> nr_partials += n->nr_partial;
> nr_slabs += atomic_long_read(&n->nr_slabs);
> - nr_inuse += count_partial(n);
> + nr_objs += atomic_long_read(&n->total_objects);
So does ->total_objects contain the total amount of objects (not
necessarily in use) including the partial list or not? AFAICT it
_does_ include slabs in the partial list too so nr_objs is correct
here.
> + nr_partial_inuse += count_partial_inuse(n);
> + nr_partial_total += count_partial_total(s, n);
> }
>
> - nr_objs = nr_slabs * s->objects;
> - nr_inuse += (nr_slabs - nr_partials) * s->objects;
> + nr_inuse = nr_objs - (nr_partial_total - nr_partial_inuse);
So if nr_objs contains the total number of objects in all slabs
including those that are in the partial list, this looks correct also.
Pekka
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-03-01 10:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080229044803.482012397@sgi.com>
[not found] ` <20080229044820.044485187@sgi.com>
2008-02-29 8:13 ` [patch 7/8] slub: Make the order configurable for each slab cache Pekka Enberg
2008-02-29 19:37 ` Christoph Lameter
2008-03-01 9:47 ` Pekka Enberg
2008-03-03 17:49 ` Christoph Lameter
2008-03-03 22:56 ` Pekka Enberg
2008-03-03 23:36 ` Christoph Lameter
[not found] ` <20080229044820.298792748@sgi.com>
2008-02-29 8:13 ` [patch 8/8] slub: Simplify any_slab_object checks Pekka Enberg
[not found] ` <20080229044819.800974712@sgi.com>
2008-02-29 8:19 ` [patch 6/8] slub: Adjust order boundaries and minimum objects per slab Pekka Enberg
2008-02-29 19:41 ` Christoph Lameter
2008-03-01 9:58 ` Pekka J Enberg
2008-03-03 17:52 ` Christoph Lameter
2008-03-03 21:34 ` Matt Mackall
2008-03-03 22:36 ` Christoph Lameter
[not found] ` <20080229044818.999367120@sgi.com>
2008-02-29 8:59 ` [patch 3/8] slub: Update statistics handling for variable order slabs Pekka Enberg
2008-02-29 19:43 ` Christoph Lameter
2008-03-01 10:29 ` Pekka Enberg [this message]
2008-03-04 12:20 ` [patch 0/8] slub: Fallback to order 0 and variable order slab support Mel Gorman
2008-03-04 18:53 ` Christoph Lameter
2008-03-05 18:28 ` Mel Gorman
2008-03-05 18:52 ` Christoph Lameter
2008-03-06 22:04 ` Mel Gorman
2008-03-06 22:18 ` Christoph Lameter
2008-03-07 12:17 ` Mel Gorman
2008-03-07 19:50 ` Christoph Lameter
2008-03-04 19:01 ` Matt Mackall
2008-03-05 0:04 ` 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=84144f020803010229l7ad52a82o42a06d4de2bf6035@mail.gmail.com \
--to=penberg@cs.helsinki.fi \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mpm@selenic.com \
/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;
as well as URLs for NNTP newsgroup(s).