Re: [RFC][PATCH 1/3] mm: slab: create helpers for slab ->freelistpointer

From: Christoph Lameter
Date: Thu Dec 12 2013 - 14:32:29 EST


On Wed, 11 Dec 2013, Dave Hansen wrote:

>
> We have a need to move the ->freelist data around 'struct page'
> in order to keep a cmpxchg aligned. First step is to add an
> accessor function which we will hook in to in the next patch.
>
> I'm not super-happy with how this looks. It's a bit ugly, but it
> does work. I'm open to some better suggestions for how to do
> this.


I think the mapping field is not used by SLUB and its ok to use since SLAB
uses it for its memory pointer. Maybe you can use that to get the correct
alignment? Do an and of address used for the cmpxchg with 0xffff
.. ff0 to ensure proper aligment (the resulting address may overlap
the mapping field).

--
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/