What is the performance impact?
More comments follow...
How does the page mask work for order 1 and other higher order allocations?
This is page_address(c->page)?
page_address(c->page) + (c->freeoffset & (PAGE_MASK << s->order)) ?
store the page mask also in the kmem_cache_cpu structure?
How is this going to show up as an atomic update? You modify multiple per
cpu fields and an interrupt could happen in between.
The original code is wrong. It should be
That use of set_freelist is safe since interrupts are disabled. So the
function can only be used i interrupts are disabled?
How does this work? You replace the freeoffset with the the once
incremented by the object offset??? The objects may not be in sequence on
the freelist and the increment wont get you to the next object anyways
since c->offset is usually 0.