]> 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, 7 Sep 2012 00:18:00 +0000 (10:18 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Sep 2012 05:36:08 +0000 (15:36 +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 b85efa77394989bf8dafabb3eb01e5dfa2c64d7d..392c5dac1981be79b4aff040e552b48c78c5751f 100644 (file)
@@ -560,6 +560,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 bdaec92353c2cc0e5e876115ee7a474e45c0ba4b..c830c857c663a4958379937f623097973e4b36de 100644 (file)
@@ -275,6 +275,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 022cecb0757dd0986b0f86f634847bd98fa89a97..d8d70f920389b47e16bef281606815205584927c 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 cf7f3c67c8b7848e6e8e55b83c3c76bde007f60a..962b4f8f7994005c85e16869887cf9f9cb505724 100644 (file)
@@ -454,6 +454,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 9870417c26e7c43852f98b3d641445b5a94c40b1..d5fc598d6e4ac554f527bebc036d9ad7ba798c81 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 316b07a866d246fbd9ae1880112f3387d66bdef0..847e7ec98b9ae8a370293d72e86915a489e704ca 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 db8a404a51dd03436653c0a52d0a6e5330bbe5bc..d4ce77a0232762dabc13dff348a98a8c86a3041d 100644 (file)
@@ -977,6 +977,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 f1813120d753e23ce153e700dd62d4d0d871d779..0c704608b5f2680543b5f6c41ccb95f57101d7db 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 2768138eefeef85707f9ee29652532b25d50dfcb..7ae1f4a0df8c8f6dff17a837eac106c2bd025e7a 100644 (file)
@@ -709,6 +709,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 504fb3f514200864d63b3ea799cb0aabf9b93b02..0e17142854042ef1337a5a7eebde9bbce55c9ccd 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 3f6854df66fbd8917ea77b88303e4a776c7f4630..0c1b869086f9ae29971177db42271a8c68d47afe 100644 (file)
@@ -1017,6 +1017,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 05e897fe9866c49fb96fa09459240bf7a550586c..fd8e47cd898b294abe0c6c2c7207ba8fa59df61f 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 dae933b69ae45e0c8f96b33ca5733777bf9d9ee8..d7f98ba724565b1c89ef5b8c6754d3524e68a197 100644 (file)
@@ -1198,6 +1198,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 4eb873e0c07b137c0225f30b20fdf78bfb0c0006..941d7a8c2197dd17eb0ab3b7ade3211f75a14a57 100644 (file)
@@ -482,6 +482,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 706a12c083ea726a7a268d647ae266b02a3a2ca7..3cb1da56eb73438bf6137405e7ec9997399e1d96 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 8349a899912e5c47ca26c66df1be66c684bdce4d..c4b85d064e6bb91bd542dd36066be1bde6d86f7a 100644 (file)
@@ -1042,6 +1042,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 29037c365ba4f4807eca405680def2c78353f966..f94cde4527e880078ed2dd20f1148f0c030eaa7f 100644 (file)
@@ -114,6 +114,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 c55c7452d2857c1f0f59042f5b6ffd1de9eba8b6..3735347fd5f6fe7ac52d4548feba02213927a001 100644 (file)
@@ -903,6 +903,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 6984562738d36bc4142a3e0556730ae9e3bf3a57..121bba2cf6f2cff56f7e2f90fcbe204d02e52fd1 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 2a503ad020d5da4bd1de5442e306f5b98a0b02d9..dc8d3629c20a39636f0dfc5f9b462d333fde80c0 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 9b47610338f59f03f6b4fdc0280d6aa61c266d4f..e4c716d374a86b16352f539a1cdd364c652986ad 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 2bc149d6a784e74ba485216d888ccd95f12e9516..fe08d4afa10636c24d1a9085397aa10b5c9d6f80 100644 (file)
@@ -3168,6 +3168,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 552e994e3aa156dff4f6aa43fa87e3885ee44513..9534b4f765790324e5d571c91c8e1d380c0fadad 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 2049c814bda475a7e02e9e4411d54cc74f304660..1b37fff7b5ff00b36a405e24d959775ec5568f20 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 80e1e2b18df17f3537050cd7557955a1c1cd6b49..0d0c50bd3321d3e5f54d00a28bccaa27afbb6da4 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 7d51f2802bda30b73fb1ba87890609c43b9462a5..862e119d7d0c1d26249d910b50967f32f4691909 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 18fc038a438da4b6bbf58fa73c23c27ecd0cb721..b8d27642ab061a79b3f96b5a4bd90cfe2377d8ea 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 e8e6be439bcd5c98a66e04581a0af0ba12b43b24..74de1ebe096eb617f3abb2e6ca8f6b4dc3db95cc 100644 (file)
@@ -1505,6 +1505,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);