Skip to content

Commit

Permalink
slub: do not put a slab to cpu partial list when cpu_partial is 0
Browse files Browse the repository at this point in the history
In free path, we don't check number of cpu_partial, so one slab can
be linked in cpu partial list even if cpu_partial is 0. To prevent this,
we should check number of cpu_partial in put_cpu_partial().

Acked-by: Christoph Lameeter <cl@linux.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Joonsoo Kim authored and Pekka Enberg committed Jul 7, 2013
1 parent c17fd13 commit 318df36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,9 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
int pages;
int pobjects;

if (!s->cpu_partial)
return;

do {
pages = 0;
pobjects = 0;
Expand Down

0 comments on commit 318df36

Please sign in to comment.