Re: [RFC][PATCH 0/7] re-shrink 'struct page' when SLUB is on.

From: Dave Hansen
Date: Mon Dec 16 2013 - 19:47:27 EST


On 12/16/2013 04:01 PM, Andrew Morton wrote:
> On Fri, 13 Dec 2013 15:59:03 -0800 Dave Hansen <dave@xxxxxxxx> wrote:
>> SLUB depends on a 16-byte cmpxchg for an optimization. For the
>> purposes of this series, I'm assuming that it is a very important
>> optimization that we desperately need to keep around.
>
> What if we don't do that.

I'll do some testing and see if I can coax out any delta from the
optimization myself. Christoph went to a lot of trouble to put this
together, so I assumed that he had a really good reason, although the
changelogs don't really mention any.

I honestly can't imagine that a cmpxchg16 is going to be *THAT* much
cheaper than a per-page spinlock. The contended case of the cmpxchg is
way more expensive than spinlock contention for sure.

fc9bb8c768's commit message says:
> The doublewords must be properly aligned for cmpxchg_double to work.
> Sadly this increases the size of page struct by one word on some architectures.
> But as a resultpage structs are now cacheline aligned on x86_64.

I'm not sure what aligning them buys us though. I think I just
demonstrated that cache footprint is *way* more important than alignment.
--
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/