Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755247Ab0AFHZ0 (ORCPT ); Wed, 6 Jan 2010 02:25:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752987Ab0AFHZ0 (ORCPT ); Wed, 6 Jan 2010 02:25:26 -0500 Received: from mga10.intel.com ([192.55.52.92]:37095 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752166Ab0AFHZZ (ORCPT ); Wed, 6 Jan 2010 02:25:25 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.49,226,1262592000"; d="scan'208";a="761726063" Message-ID: <4B443AE3.2080800@linux.intel.com> Date: Wed, 06 Jan 2010 15:25:23 +0800 From: Haicheng Li User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: Christoph Lameter , linux-mm@kvack.org CC: Matt Mackall , Pekka Enberg , Andi Kleen , Eric Dumazet , linux-kernel@vger.kernel.org Subject: [PATCH v3] slab: initialize unused alien cache entry as NULL at alloc_alien_cache(). Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1350 Lines: 42 Comparing with existing code, it's a simpler way to use kzalloc_node() to ensure that each unused alien cache entry is NULL. CC: Pekka Enberg CC: Eric Dumazet Acked-by: Andi Kleen Acked-by: Christoph Lameter Reviewed-by: Matt Mackall Signed-off-by: Haicheng Li --- mm/slab.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 7dfa481..5d1a782 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp) if (limit > 1) limit = 12; - ac_ptr = kmalloc_node(memsize, gfp, node); + ac_ptr = kzalloc_node(memsize, gfp, node); if (ac_ptr) { for_each_node(i) { - if (i == node || !node_online(i)) { - ac_ptr[i] = NULL; + if (i == node || !node_online(i)) continue; - } ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); if (!ac_ptr[i]) { for (i--; i >= 0; i--) -- 1.5.3.8 -- 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/