[lkml]   [2011]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 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.

 \ /
  Last update: 2011-05-25 16:27    [W:0.102 / U:4.556 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site