Re: [patch 2/3] slub: scan partial list for free slabs whenthrashing

From: Pekka Enberg
Date: Tue Mar 31 2009 - 04:49:27 EST


Hi David,

On Mon, 2009-03-30 at 10:37 -0400, Christoph Lameter wrote:
> > > That adds fastpath overhead and it shows for small objects in your tests.

On Tue, 31 Mar 2009, Pekka Enberg wrote:
> > Yup, and looking at this:
> >
> > + u16 fastpath_allocs; /* Consecutive fast allocs before slowpath */
> > + u16 slowpath_allocs; /* Consecutive slow allocs before watermark */
> >
> > How much do operations on u16 hurt on, say, x86-64?

On Tue, 2009-03-31 at 01:23 -0700, David Rientjes wrote:
> As opposed to unsigned int? These simply use the word variations of the
> mov, test, cmp, and inc instructions instead of long. It's the same
> tradeoff when using the u16 slub fields within struct page except it's not
> strictly required in this instance because of size limitations, but rather
> for cacheline optimization.

I was thinking of partial register stalls. But looking at it on x86-64,
the generated asm seems sane. I see tons of branch instructions, though,
so simplifying this somehow:

+ if (is_empty) {
+ if (c->fastpath_allocs < s->min_free_watermark)
+ c->slowpath_allocs++;
+ else if (c->slowpath_allocs)
+ c->slowpath_allocs--;
+ } else
+ c->slowpath_allocs = 0;
+ c->fastpath_allocs = 0;

would be most welcome.

Pekka

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/