fs: push rcu_barrier() from deactivate_locked_super() to filesystems
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 26 Sep 2012 01:33:07 +0000 (11:33 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 3 Oct 2012 01:35:55 +0000 (21:35 -0400)
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>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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 c70f1e5fc0247a616d44e60c2681bbf8fc14c747..2f57053bf26c391b19e41383fd6e1dc1f1e122de 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 ec154f95464696cfa7df3cd6ab87ac4a0185ed03..cf03a91d806fa3c44921bcdf071c2f51c89374b9 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 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 9b627c15010a3af35e1f2ec85ccafc2b18d97d44..34fcde765d242e3e04421d49f17f81a8a496eb58 100644 (file)
@@ -710,6 +710,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 8c892e93d8e7b6f2ff727709619eedde0e880812..8d41c8889eee722ed95e07ee98f7eb1fee257a50 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 c6e0cb3d1f4a9e3730aea4904037eb0e9d4dd6d8..455b7d8c6d62fe6a2f50cc4927d7186b99865001 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 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 fca222dabe3ccc4a791e894d325bdc4e4f78b7f3..f0eda124cffb7714daf51c475dcabc8c955056e0 100644 (file)
@@ -1197,6 +1197,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 61ea41389f90d91d8b3ab6a6a39cd580720f1950..ff487954cd96f1447b254b28a41fcdbd82b61b55 100644 (file)
@@ -418,6 +418,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 333df07ae3bd2387e0425fd2523de5e95b05667b..0c62c55b25d76d4e58358c4ec161d04df6d0ac4e 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 71a197f0f93d24c0cc33527d4f2d69c8c3d51f7b..36e09ca9130b0743201d20c56c2e278b7b1709a5 100644 (file)
@@ -2298,6 +2298,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 19e2380fb8679d2e8641e691eaeb0b200456bfb4..83d36e473d2f98ffc3b65f5e1f7f17c7e0f5861c 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);