]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs: push rcu_barrier() from deactivate_locked_super() to filesystems
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fri, 21 Sep 2012 00:57:11 +0000 (10:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Sep 2012 08:46:00 +0000 (18:46 +1000)
There's no reason to call rcu_barrier() on every
deactivate_locked_super().  We only need to make sure that all delayed rcu
free inodes are flushed before we destroy related cache.

Removing rcu_barrier() from deactivate_locked_super() affects some fast
paths.  E.g.  on my machine exit_group() of a last process in IPC
namespace takes 0.07538s.  rcu_barrier() takes 0.05188s of that time.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
47 files changed:
fs/9p/v9fs.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/super.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/ceph/super.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/ecryptfs/main.c
fs/efs/super.c
fs/exofs/super.c
fs/ext2/super.c
fs/ext3/super.c
fs/ext4/super.c
fs/fat/inode.c
fs/freevxfs/vxfs_super.c
fs/fuse/inode.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/super.c
fs/logfs/inode.c
fs/minix/inode.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/nilfs2/super.c
fs/ntfs/super.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/super.c
fs/openpromfs/inode.c
fs/qnx4/inode.c
fs/qnx6/inode.c
fs/reiserfs/super.c
fs/romfs/super.c
fs/squashfs/super.c
fs/super.c
fs/sysv/inode.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/xfs_super.c

index b20af74657860bd19018809bdb8e1721a5820a4d..d934f04e77368e00dc76d4a54720cff0758d3a58 100644 (file)
@@ -568,6 +568,11 @@ static int v9fs_init_inode_cache(void)
  */
 static void v9fs_destroy_inode_cache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(v9fs_inode_cache);
 }
 
index 22a0d7ed5fa1c45bf412d42346f7c003c929185a..d5712293579376a89a99befc8eb59e5ecded02bb 100644 (file)
@@ -280,6 +280,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(adfs_inode_cachep);
 }
 
index 1f030825cd3a3f5cb77b5f938efb70a6bd6a018c..b84dc7352502df2976438435b2523f98d5d55966 100644 (file)
@@ -147,6 +147,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(affs_inode_cachep);
 }
 
index df8c6047c2a12c41e5cd2935066e9b0397226d9a..43165009428da56c51b47ae9d8bb4b97310c485f 100644 (file)
@@ -123,6 +123,11 @@ void __exit afs_fs_exit(void)
                BUG();
        }
 
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(afs_inode_cachep);
        _leave("");
 }
index 7f73a692bfd0ebfdc11533346aca0283e746edde..2b3bda8d5e6838619222359de38370baedfce7a4 100644 (file)
@@ -457,6 +457,11 @@ befs_init_inodecache(void)
 static void
 befs_destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(befs_inode_cachep);
 }
 
index b242beba58edcd35c41dea3ecf86ee1181be97db..737aaa3f709062a9d8aec826c26e956b18eb2bcf 100644 (file)
@@ -280,6 +280,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(bfs_inode_cachep);
 }
 
index 4c878476bb91ce0985dabc25464622442aaca54a..b08ea4717e9d70ef7967fe33c1658b669eee16ac 100644 (file)
@@ -107,6 +107,12 @@ void extent_io_exit(void)
                list_del(&eb->leak_list);
                kmem_cache_free(extent_buffer_cache, eb);
        }
+
+       /*
+        * Make sure all delayed rcu free are flushed before we
+        * destroy caches.
+        */
+       rcu_barrier();
        if (extent_state_cache)
                kmem_cache_destroy(extent_state_cache);
        if (extent_buffer_cache)
index 2a028a58619cdaca85ff21b4b74bc3324bf6bfea..a6ed6944e50c42eb67a659c1eda6a5f17650d97e 100644 (file)
@@ -7076,6 +7076,11 @@ static void init_once(void *foo)
 
 void btrfs_destroy_cachep(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        if (btrfs_inode_cachep)
                kmem_cache_destroy(btrfs_inode_cachep);
        if (btrfs_trans_handle_cachep)
index b982239f38f91dfab38fcc093e600d5b11e5c632..3a42d9326378d5aa3b2a18b9358a142bdcac51db 100644 (file)
@@ -603,6 +603,11 @@ bad_cap:
 
 static void destroy_caches(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ceph_inode_cachep);
        kmem_cache_destroy(ceph_cap_cachep);
        kmem_cache_destroy(ceph_dentry_cachep);
index a41044a310836cf28c65b9b8db7ab65659a54971..e7931cc55d0c96f7a4edde39d5fbd78fa24f82af 100644 (file)
@@ -968,6 +968,11 @@ cifs_init_inodecache(void)
 static void
 cifs_destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(cifs_inode_cachep);
 }
 
index d315c6c5891aa78c1d5821d5fb6bdeb6e565f8e7..be2aa49094877c22d326b0466d9cfc32bb6ed94b 100644 (file)
@@ -85,6 +85,11 @@ int coda_init_inodecache(void)
 
 void coda_destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(coda_inode_cachep);
 }
 
index 24bb043e50d9234aa997fbf2175c8b7594b43e3b..4e0886c9e5c476059346f5a0d520257418ce03ba 100644 (file)
@@ -711,6 +711,12 @@ static void ecryptfs_free_kmem_caches(void)
 {
        int i;
 
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
+
        for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) {
                struct ecryptfs_cache_info *info;
 
index e755ec746c6967ed12e9ea036ddcd83214770d48..2002431ef9a0ff238d838b9d4c2f8bb9760007fa 100644 (file)
@@ -96,6 +96,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(efs_inode_cachep);
 }
 
index dde41a75c7c8dbd36597272a13f5c6f3487507d3..59e3bbfac0b17af51d9101b0d35dc6414ad53187 100644 (file)
@@ -206,6 +206,11 @@ static int init_inodecache(void)
  */
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(exofs_inode_cachep);
 }
 
index af74d9e27b71b0cf569cac645e362c174c44389e..6c205d0c565b2595fe837eab5cf789d995df2d18 100644 (file)
@@ -206,6 +206,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ext2_inode_cachep);
 }
 
index c955e2dffa8e0b1db337ee26913b9feee6e08308..17ae5c83d2346353272fb0c42ed52f1a20aa3c70 100644 (file)
@@ -532,6 +532,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ext3_inode_cachep);
 }
 
index afbddf947f1bce7e27f79bf0f1f02d9bd6d13a1e..bb23f543fb9474a72b50cf6668b1a9a44e7a2608 100644 (file)
@@ -1019,6 +1019,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ext4_inode_cachep);
 }
 
index 47d9eb0be8869016ab0d0d4a6a9dd086c7904abb..4e5a6ac54ebd9deec1e8bfeb430eb3c7608dc78d 100644 (file)
@@ -521,6 +521,11 @@ static int __init fat_init_inodecache(void)
 
 static void __exit fat_destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(fat_inode_cachep);
 }
 
index d4fabd26084ed8340e772e3699faa2e9e239da91..fed2c8afb3a9f401945ca5d8a226a4df5ebb4c9f 100644 (file)
@@ -279,6 +279,11 @@ static void __exit
 vxfs_cleanup(void)
 {
        unregister_filesystem(&vxfs_fs_type);
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(vxfs_inode_cachep);
 }
 
index 407392d88aaf8ec6673057ad623856e0fe619f19..11c08189d06b733330830a32f720584cdaeb8ec2 100644 (file)
@@ -1200,6 +1200,12 @@ static void fuse_fs_cleanup(void)
 {
        unregister_filesystem(&fuse_fs_type);
        unregister_fuseblk();
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(fuse_inode_cachep);
 }
 
index 0b63d135a092e89c5251ba0f2b87aacd718827ea..e93ddaadfd1e445fa89e976c9692f2afa302094c 100644 (file)
@@ -492,6 +492,12 @@ static int __init init_hfs_fs(void)
 static void __exit exit_hfs_fs(void)
 {
        unregister_filesystem(&hfs_fs_type);
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(hfs_inode_cachep);
 }
 
index fdafb2d71654740776bd1b77931b955da350ecad..811a84d2d9643677832219a0b960c6d42109480e 100644 (file)
@@ -635,6 +635,12 @@ static int __init init_hfsplus_fs(void)
 static void __exit exit_hfsplus_fs(void)
 {
        unregister_filesystem(&hfsplus_fs_type);
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(hfsplus_inode_cachep);
 }
 
index a152783602d946361ef68eb61f81e28d0d9b2d82..bc28bf077a6abe92b4041be6f6057cd6815fd57b 100644 (file)
@@ -210,6 +210,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(hpfs_inode_cachep);
 }
 
index 6e572c4fbf686c2bb3c0efe3fd40baa21ca3e90a..9460120a5170213cc7bf1e3e6d79db4674b63571 100644 (file)
@@ -1048,6 +1048,11 @@ static int __init init_hugetlbfs_fs(void)
 
 static void __exit exit_hugetlbfs_fs(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(hugetlbfs_inode_cachep);
        kern_unmount(hugetlbfs_vfsmount);
        unregister_filesystem(&hugetlbfs_fs_type);
index a7d8e6cc5e0c140cb29253c1d9433215584c6ccf..67ce52507d7dec7f2f009624979ffa4910f8ea36 100644 (file)
@@ -115,6 +115,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(isofs_inode_cachep);
 }
 
index 1224d6b48e7e5270830928e323da026a7fe33c41..d3d8799e2187233e23e1614990443203d4fff1ad 100644 (file)
@@ -422,6 +422,12 @@ static void __exit exit_jffs2_fs(void)
        unregister_filesystem(&jffs2_fs_type);
        jffs2_destroy_slab_caches();
        jffs2_compressors_exit();
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(jffs2_inode_cachep);
 }
 
index 53b896446e6cfdb702e55bc77abb07bbaf510c88..1a543be09c793bb150efe07f73b92c5b85b4b3d1 100644 (file)
@@ -952,6 +952,12 @@ static void __exit exit_jfs_fs(void)
        jfs_proc_clean();
 #endif
        unregister_filesystem(&jfs_fs_type);
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(jfs_inode_cachep);
 }
 
index bda39085309fc0e5cac8ba97c1809a6826b0d3a9..adb90116d36b1b2b0f0328a58cae9cdf0dde1794 100644 (file)
@@ -417,5 +417,10 @@ int logfs_init_inode_cache(void)
 
 void logfs_destroy_inode_cache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(logfs_inode_cache);
 }
index d0e42c6789237d544b286e5113c72426d803a5e8..4fc5f8ab1c44a47534e1b2b9a0bb338aea451dc7 100644 (file)
@@ -100,6 +100,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(minix_inode_cachep);
 }
 
index eaa74323663aa2b769971a279045734fdcee7f82..d7e9fe77188a6869073bae3daa8c5a731d2a1edb 100644 (file)
@@ -89,6 +89,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ncp_inode_cachep);
 }
 
index 126a4cbbb98f5b8fc8dbd0d831f5ca88d165351f..5c7325c5c5e66b23beacd6fb7485fda5a640dcd9 100644 (file)
@@ -1571,6 +1571,11 @@ static int __init nfs_init_inodecache(void)
 
 static void nfs_destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(nfs_inode_cachep);
 }
 
index 6a10812711c1d37bca6660530cd6c34cbb7b30fb..3c991dc84f2f2df6f8c9dccd922d8edbf1ff32a5 100644 (file)
@@ -1382,6 +1382,12 @@ static void nilfs_segbuf_init_once(void *obj)
 
 static void nilfs_destroy_cachep(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
+
        if (nilfs_inode_cachep)
                kmem_cache_destroy(nilfs_inode_cachep);
        if (nilfs_transaction_cachep)
index da01c165067ddc60e46044a9d736086d3b91dcf0..4a8289f8b16c87495e8e6b94fccc6f83c5643c7e 100644 (file)
@@ -3193,6 +3193,12 @@ static void __exit exit_ntfs_fs(void)
        ntfs_debug("Unregistering NTFS driver.");
 
        unregister_filesystem(&ntfs_fs_type);
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ntfs_big_inode_cache);
        kmem_cache_destroy(ntfs_inode_cache);
        kmem_cache_destroy(ntfs_name_cache);
index 83b6f98e0665433bda36a2f1d4f34a1ce7bec4cd..16b712d260d4fcb628fa67e13f1684b9239698d6 100644 (file)
@@ -691,6 +691,11 @@ static void __exit exit_dlmfs_fs(void)
        flush_workqueue(user_dlm_worker);
        destroy_workqueue(user_dlm_worker);
 
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(dlmfs_inode_cache);
 
        bdi_destroy(&dlmfs_backing_dev_info);
index 68f4541c2db98b26a3aba49234c721e56d56e3c3..0e91ec22a940ea1488bab00191b8f54356578bd5 100644 (file)
@@ -1818,6 +1818,11 @@ static int ocfs2_initialize_mem_caches(void)
 
 static void ocfs2_free_mem_caches(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        if (ocfs2_inode_cachep)
                kmem_cache_destroy(ocfs2_inode_cachep);
        ocfs2_inode_cachep = NULL;
index 4a3477949bca6da23a13161708e0ee7168fdb654..2ad080faca34e38d2ac8c5aed09a33135cae7d29 100644 (file)
@@ -463,6 +463,11 @@ static int __init init_openprom_fs(void)
 static void __exit exit_openprom_fs(void)
 {
        unregister_filesystem(&openprom_fs_type);
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(op_inode_cachep);
 }
 
index 5c3c7b02e17b7f6d91af741e668e1ab1a9db1b87..43098bb5723af2890acaaa8d2f3a86a37fc7b811 100644 (file)
@@ -391,6 +391,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(qnx4_inode_cachep);
 }
 
index f4eef0b5e7b5203a908ba40f2a4dc88a239a2e4c..b6addf560483f0877078946050d90efb1f7d2344 100644 (file)
@@ -651,6 +651,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(qnx6_inode_cachep);
 }
 
index 7a37dabf5a968b7c8977c2028665f58554987912..1078ae179993bb12f105d39fb1d847eb84c12414 100644 (file)
@@ -608,6 +608,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(reiserfs_inode_cachep);
 }
 
index 77c5f21739837753efdfed09e806e32d1376a219..fd7c5f60b46b84f9cdcba814c2c5e803ef02daa2 100644 (file)
@@ -648,6 +648,11 @@ error_register:
 static void __exit exit_romfs_fs(void)
 {
        unregister_filesystem(&romfs_fs_type);
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(romfs_inode_cachep);
 }
 
index 29cd014ed3a17a776db73b4c1e492f44d78cba4e..260e3928d4f52bb94076e0025f5fd8bef08bb1c3 100644 (file)
@@ -425,6 +425,11 @@ static int __init init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(squashfs_inode_cachep);
 }
 
index 0902cfa6a12efd21e4ebd52a39333b7f9d6270eb..5fdf7ff32c4e283e74373bbabe00f9e165d5aa41 100644 (file)
@@ -307,12 +307,6 @@ void deactivate_locked_super(struct super_block *s)
 
                /* caches are now gone, we can safely kill the shrinker now */
                unregister_shrinker(&s->s_shrink);
-
-               /*
-                * We need to call rcu_barrier so all the delayed rcu free
-                * inodes are flushed before we release the fs module.
-                */
-               rcu_barrier();
                put_filesystem(fs);
                put_super(s);
        } else {
index b23ab736685dd5f43718fd473b9fff08e827cda9..d33e506c1eacabcebfd354f6ceedf52a3111a6d7 100644 (file)
@@ -360,5 +360,10 @@ int __init sysv_init_icache(void)
 
 void sysv_destroy_icache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(sysv_inode_cachep);
 }
index 96c90d1e76162b774340c9e153251f5fca773752..ddc0f6ae65e9992af3dc689ad61021e86c5e40a1 100644 (file)
@@ -2289,6 +2289,12 @@ static void __exit ubifs_exit(void)
        dbg_debugfs_exit();
        ubifs_compressors_exit();
        unregister_shrinker(&ubifs_shrinker_info);
+
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ubifs_inode_slab);
        unregister_filesystem(&ubifs_fs_type);
 }
index 862741dddf27b7c935a15aef40b6b057970b93ad..d44fb568abe1a945c014a03c88648cd847906cc0 100644 (file)
@@ -171,6 +171,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(udf_inode_cachep);
 }
 
index 444927e5706b773380d9050213a8179b3d611fd9..f7cfecfe1caba90f9c6dc8d1cde2938e5128cb79 100644 (file)
@@ -1466,6 +1466,11 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
+       /*
+        * Make sure all delayed rcu free inodes are flushed before we
+        * destroy cache.
+        */
+       rcu_barrier();
        kmem_cache_destroy(ufs_inode_cachep);
 }
 
index 001537f92caf10becdaa26ab27ee2f944e489511..e0fd2734189ee561478cb8dfdd427baf6168ecfc 100644 (file)
@@ -1506,6 +1506,11 @@ xfs_init_zones(void)
 STATIC void
 xfs_destroy_zones(void)
 {
+       /*
+        * Make sure all delayed rcu free are flushed before we
+        * destroy caches.
+        */
+       rcu_barrier();
        kmem_zone_destroy(xfs_ili_zone);
        kmem_zone_destroy(xfs_inode_zone);
        kmem_zone_destroy(xfs_efi_zone);