Messages in this thread | | | Date | Wed, 25 May 2011 09:25:12 -0500 (CDT) | From | Christoph Lameter <> | Subject | Re: SLUB regression in current Linus |
| |
On Tue, 24 May 2011, Linus Torvalds wrote:
> Look at __slab_alloc: we have: > > > page = c->page; > if (!page) > goto new_slab; > > slab_lock(page); > if (unlikely(!node_match(c, node))) > goto another_slab; > > and let's assume we have two users racing on that "c->page". The > "slab_lock()" is going to work for one of them, right?
There cannot be two users racing through this code segment since we have interrupts disabled and c is pointing to a per cpu structure. c->page points to a page that can only be allocated from from the current processor (from the freelist in c->freelist) but it can be freed to from multiple cpus (via the page->freelist). The code that you are discussing is copying the freed objects from the page->freelist to the per cpu freelist and it needs to lock out the slab_free path to do that.
| |