Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760365AbZFWPEk (ORCPT ); Tue, 23 Jun 2009 11:04:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760254AbZFWPEB (ORCPT ); Tue, 23 Jun 2009 11:04:01 -0400 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:36328 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760155AbZFWPD5 (ORCPT ); Tue, 23 Jun 2009 11:03:57 -0400 From: Jesper Dangaard Brouer Subject: [PATCH 01/10] ext4: Use rcu_barrier() on module unload. To: "David S. Miller" Cc: Jesper Dangaard Brouer , "Paul E. McKenney" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dougthompson@xmission.com, bluesmoke-devel@lists.sourceforge.net, axboe@kernel.dk, "Patrick McHardy" , christine.caulfield@googlemail.com, Trond.Myklebust@netapp.com, linux-wireless@vger.kernel.org, johannes@sipsolutions.net, yoshfuji@linux-ipv6.org, shemminger@linux-foundation.org, linux-nfs@vger.kernel.org, bfields@fieldses.org, neilb@suse.de, linux-ext4@vger.kernel.org, tytso@mit.edu, adilger@sun.com, netfilter-devel@vger.kernel.org Date: Tue, 23 Jun 2009 17:03:59 +0200 Message-ID: <20090623150358.22490.24818.stgit@localhost> In-Reply-To: <20090623150330.22490.87327.stgit@localhost> References: <20090623150330.22490.87327.stgit@localhost> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1221 Lines: 38 The ext4 module uses rcu_call() thus it should use rcu_barrier()on module unload. The kmem cache ext4_pspace_cachep is sometimes free'ed using call_rcu() callbacks. Thus, we must wait for completion of call_rcu() before doing kmem_cache_destroy(). I have difficult determining if no new call_rcu() callbacks can be envoked. Would the maintainer please verify this? Signed-off-by: Jesper Dangaard Brouer --- fs/ext4/mballoc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 519a0a6..e271a9e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2902,8 +2902,10 @@ int __init init_ext4_mballoc(void) void exit_ext4_mballoc(void) { - /* XXX: synchronize_rcu(); */ + /* Wait for completion of call_rcu()'s on ext4_pspace_cachep */ + rcu_barrier(); kmem_cache_destroy(ext4_pspace_cachep); + kmem_cache_destroy(ext4_ac_cachep); kmem_cache_destroy(ext4_free_ext_cachep); } -- 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/