Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754597Ab0HaFjx (ORCPT ); Tue, 31 Aug 2010 01:39:53 -0400 Received: from ozlabs.org ([203.10.76.45]:59860 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751919Ab0HaFjw (ORCPT ); Tue, 31 Aug 2010 01:39:52 -0400 Date: Tue, 31 Aug 2010 15:36:13 +1000 From: Anton Blanchard To: Nitin Gupta Cc: Pekka Enberg , Minchan Kim , Andrew Morton , Greg KH , Linux Driver Project , linux-mm , linux-kernel Subject: Re: [PATCH 03/10] Use percpu stats Message-ID: <20100831053613.GA14848@kryten> References: <1281374816-904-1-git-send-email-ngupta@vflare.org> <1281374816-904-4-git-send-email-ngupta@vflare.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1281374816-904-4-git-send-email-ngupta@vflare.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 40 Hi, > + zram->stats = alloc_percpu(struct zram_stats_cpu); > + if (!zram->stats) { > + pr_err("Error allocating percpu stats\n"); > + ret = -ENOMEM; > + goto fail; > + } There doesn't seem to be a free_percpu() in the module exit path. Something like this perhaps? Anton -- zram: Free percpu data on module exit. Signed-off-by: Anton Blanchard --- Index: powerpc.git/drivers/staging/zram/zram_drv.c =================================================================== --- powerpc.git.orig/drivers/staging/zram/zram_drv.c 2010-08-31 15:15:59.344290847 +1000 +++ powerpc.git/drivers/staging/zram/zram_drv.c 2010-08-31 15:17:00.383045836 +1000 @@ -483,8 +483,7 @@ void zram_reset_device(struct zram *zram xv_destroy_pool(zram->mem_pool); zram->mem_pool = NULL; - /* Reset stats */ - memset(&zram->stats, 0, sizeof(zram->stats)); + free_percpu(&zram->stats); zram->disksize = zram_default_disksize(); mutex_unlock(&zram->init_lock); -- 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/