lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/3] mm: slab: create helpers for slab ->freelist pointer
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).



\
 
 \ /
  Last update: 2013-12-12 21:01    [W:0.090 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site