Re: [RFC][PATCH v3] slub: Keep page and object in sync inslab_alloc_node()

From: Christoph Lameter
Date: Sun Jan 20 2013 - 20:40:31 EST


On Fri, 18 Jan 2013, Eric Dumazet wrote:

> On Fri, 2013-01-18 at 18:40 +0000, Christoph Lameter wrote:
>
> > The fetching of the tid is the only critical thing here. If the tid is
> > retrieved from the right cpu then the cmpxchg will fail if any changes
> > occured to freelist or the page variable.
> >
> > The tid can be retrieved without disabling preemption through
> > this_cpu_read().
>
> Strictly speaking, this_cpu_read() _does_ disable preemption.

Yes on x86 the relocation and the fetch is just a single instruction and
therefore no preemption can occur.

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