Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier() 69/54669/5 master
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 4 Apr 2024 08:14:10 +0000 (11:14 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 15 Apr 2024 16:54:51 +0000 (16:54 +0000)
synchronize_rcu() does not wait for in-flight rcu callback completion,
thus kmem_cache_free() can still race with kmem_cache_destroy().

Fixes: a9411a9856a ("LU-17076 nrs: wait for RCU completion")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I2da668c06b532a41c8ce2fe681ea17cf6f3013ef
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54669
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/ldlm/ldlm_lockd.c
lustre/ptlrpc/nrs_orr.c

index 3a89924..c4e553c 100644 (file)
@@ -3578,7 +3578,7 @@ void ldlm_exit(void)
 {
        if (ldlm_refcount)
                CERROR("ldlm_refcount is %d in %s\n", ldlm_refcount, __func__);
-       synchronize_rcu();
+       rcu_barrier();
        kmem_cache_destroy(ldlm_resource_slab);
        /*
         * ldlm_lock_put() use RCU to call ldlm_lock_free, so need call
index 1aae791..6dd3213 100644 (file)
@@ -623,7 +623,7 @@ static void nrs_orr_stop(struct ptlrpc_nrs_policy *policy)
                rhashtable_free_and_destroy(&orrd->od_obj_hash,
                                            nrs_orr_hash_exit, NULL);
        }
-       synchronize_rcu();
+       rcu_barrier();
        kmem_cache_destroy(orrd->od_cache);
 
        OBD_FREE_PTR(orrd);