Whamcloud - gitweb
LU-11453 class: use INIT_LIST_HEAD_RCU instead INIT_LIST_HEAD 17/33317/4
authorYang Sheng <ys@whamcloud.com>
Mon, 8 Oct 2018 15:01:01 +0000 (23:01 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 23 Oct 2018 05:19:55 +0000 (05:19 +0000)
Use INIT_LIST_HEAD_RCU to avoid compiler optimization too much
in some case.

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I66b340ac3147d2cb911a2b7d3e210c6847047dac
Reviewed-on: https://review.whamcloud.com/33317
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_open.c
lustre/obdclass/genops.c

index c94af9a..3c44552 100644 (file)
@@ -478,7 +478,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
 
         lprocfs_counter_incr(ldlm_res_to_ns(resource)->ns_stats,
                              LDLM_NSS_LOCKS);
-       INIT_LIST_HEAD(&lock->l_handle.h_link);
+       INIT_LIST_HEAD_RCU(&lock->l_handle.h_link);
        class_handle_hash(&lock->l_handle, &lock_handle_ops);
 
         lu_ref_init(&lock->l_reference);
index 28d0656..2597f43 100644 (file)
@@ -63,7 +63,7 @@ struct mdt_file_data *mdt_mfd_new(const struct mdt_export_data *med)
 
        OBD_ALLOC_PTR(mfd);
        if (mfd != NULL) {
-               INIT_LIST_HEAD(&mfd->mfd_open_handle.h_link);
+               INIT_LIST_HEAD_RCU(&mfd->mfd_open_handle.h_link);
                mfd->mfd_open_handle.h_owner = med;
                INIT_LIST_HEAD(&mfd->mfd_list);
                class_handle_hash(&mfd->mfd_open_handle, &mfd_open_handle_ops);
index 1325398..84a8ce1 100644 (file)
@@ -1106,7 +1106,7 @@ struct obd_export *__class_new_export(struct obd_device *obd,
        spin_lock_init(&export->exp_uncommitted_replies_lock);
        INIT_LIST_HEAD(&export->exp_uncommitted_replies);
        INIT_LIST_HEAD(&export->exp_req_replay_queue);
-       INIT_LIST_HEAD(&export->exp_handle.h_link);
+       INIT_LIST_HEAD_RCU(&export->exp_handle.h_link);
        INIT_LIST_HEAD(&export->exp_hp_rpcs);
        INIT_LIST_HEAD(&export->exp_reg_rpcs);
        class_handle_hash(&export->exp_handle, &export_handle_ops);
@@ -1360,7 +1360,7 @@ struct obd_import *class_new_import(struct obd_device *obd)
        atomic_set(&imp->imp_replay_inflight, 0);
        atomic_set(&imp->imp_inval_count, 0);
        INIT_LIST_HEAD(&imp->imp_conn_list);
-       INIT_LIST_HEAD(&imp->imp_handle.h_link);
+       INIT_LIST_HEAD_RCU(&imp->imp_handle.h_link);
        class_handle_hash(&imp->imp_handle, &import_handle_ops);
        init_imp_at(&imp->imp_at);