Commit f3af663d authored by Pekka Enberg's avatar Pekka Enberg

SLQB: Fix locking in __slab_alloc_page()

As explained by Minchan Kim, we need to hold ->page_lock while updating
l->nr_partial in slab_alloc_page() and __cache_list_get_page().
Reported-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tested-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Analyzed-by: default avatarMinchan Kim <minchan.kim@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent 5af050bf
......@@ -1399,12 +1399,14 @@ static noinline void *__slab_alloc_page(struct kmem_cache *s,
page->list = l;
spin_lock(&n->list_lock);
spin_lock(&l->page_lock);
l->nr_slabs++;
l->nr_partial++;
list_add(&page->lru, &l->partial);
slqb_stat_inc(l, ALLOC);
slqb_stat_inc(l, ALLOC_SLAB_NEW);
object = __cache_list_get_page(s, l);
spin_unlock(&l->page_lock);
spin_unlock(&n->list_lock);
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment