Re: [rfc][patch 1/3] slub: fix small HWCACHE_ALIGN alignment

Nick Piggin
2008-03-06T02:49:26Z

On Wed, Mar 05, 2008 at 12:56:33PM -0800, Christoph Lameter wrote:
> On Wed, 5 Mar 2008, Nick Piggin wrote:
>
> > It started out as a SLUB regression that was exposing poor code in the
> > percpu allocator due to different SLUB kmalloc alignments. That prompted
>
> That was due to SLUB's support for smaller allocation sizes. AFAICT has
> nothing to do with alignment.

The smaller sizes meant objects were less often aligned on cacheline
boundaries.

> > The SMP flag was just an RFC. I think some people (like Christoph) were
> > being confused about the HWCACHE_ALIGN flag being for avoiding false
> > sharing on SMP systems. It would actually be also generally useful to
> > have the SMP flag (eg. see the sites I added it to in patch #3).
>
> Hmmm. We could define a global constant for that? Determine it on bootup
> and then pass it as an alignment parameter?

We could, but I'd rather just use the flag.