[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1112141858380.27595@chino.kir.corp.google.com>
Date: Wed, 14 Dec 2011 19:05:21 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Pekka Enberg <penberg@...nel.org>
cc: Christoph Lameter <cl@...ux.com>,
Eric Dumazet <eric.dumazet@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: slub: Fix per cpu partial statistics
On Mon, 12 Dec 2011, Pekka Enberg wrote:
> > Subject: slub: Fix per cpu partial statistics
> >
> > Support for SO_OBJECTS was not properly added to show_slab_objects().
> >
> > If SO_OBJECTS is not set then the number of slab pages needs to be
> > returned and not the number of objects in the partial slabs as now.
> >
> > We do not have that number so just return 1 until we find a better
> > way to determine that.
> >
> > Signed-off-by: Christoph Lameter <cl@...ux.com>
> >
> > ---
> > mm/slub.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > Index: linux-2.6/mm/slub.c
> > ===================================================================
> > --- linux-2.6.orig/mm/slub.c 2011-11-22 13:42:23.000000000 -0600
> > +++ linux-2.6/mm/slub.c 2011-11-22 13:47:52.000000000 -0600
> > @@ -4451,8 +4451,8 @@ static ssize_t show_slab_objects(struct
> > continue;
> >
> > if (c->page) {
> > - if (flags & SO_TOTAL)
> > - x = c->page->objects;
> > + if (flags & SO_TOTAL)
> > + x = c->page->objects;
> > else if (flags & SO_OBJECTS)
> > x = c->page->inuse;
> > else
This was already fixed up by "slub: avoid potential NULL dereference or
corruption" in slab/next, so I suggest dropping this hunk.
> > @@ -4464,7 +4464,11 @@ static ssize_t show_slab_objects(struct
> > page = c->partial;
> >
> > if (page) {
> > - x = page->pobjects;
> > + if (flags & SO_OBJECTS)
> > + x = page->pobjects;
> > + else
> > + /* Assume one */
> > + x = 1;
> > total += x;
> > nodes[c->node] += x;
> > }
> >
>
> Looks OK to me. David, Eric?
>
I thought page->pages would be better?
--
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