Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756524Ab3FSGdl (ORCPT ); Wed, 19 Jun 2013 02:33:41 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:42341 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756336Ab3FSGdk (ORCPT ); Wed, 19 Jun 2013 02:33:40 -0400 X-AuditID: 9c93016f-b7b6cae000007078-9c-51c150c37d3b From: Joonsoo Kim To: Pekka Enberg Cc: Christoph Lameter , Matt Mackall , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim Subject: [PATCH] slub: do not put a slab to cpu partial list when cpu_partial is 0 Date: Wed, 19 Jun 2013 15:33:55 +0900 Message-Id: <1371623635-26575-1-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 817 Lines: 28 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(). Signed-off-by: Joonsoo Kim diff --git a/mm/slub.c b/mm/slub.c index 57707f0..7033b4f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1955,6 +1955,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; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/