Whamcloud - gitweb
LU-15894 ofd: revert range locking in ofd 66/47466/4
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Sun, 24 Apr 2022 14:48:09 +0000 (17:48 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Jul 2022 22:30:54 +0000 (22:30 +0000)
After commit 301d76a711 (LU-14876), range locking is no longer needed
in ofd, because 301d76a711 itself prevents the original data corruption
fixed by range locking. At the same time, range locking in ofd adds
unnecessary overhead, we can even see serialization under specific load.

This patch reverts range locking but keeps recovery-small test 148
to test the original corruption scenario case.

Change-Id: Ic795bcfb1e249c4927f66b6bad456f5511819861
Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
HPE-bug-id: LUS-9890
Fixes: 35679a730 ("LU-10958 ofd: data corruption due to RPC reordering")
Reviewed-on: https://review.whamcloud.com/47466
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c

index c9bcd40..0c43df0 100644 (file)
@@ -544,7 +544,6 @@ static struct lu_object *ofd_object_alloc(const struct lu_env *env,
                lu_object_init(o, h, d);
                lu_object_add_top(h, o);
                o->lo_ops = &ofd_obj_ops;
-               range_lock_tree_init(&of->ofo_write_tree);
                RETURN(o);
        } else {
                RETURN(NULL);
index cb2280e..f3f4de7 100644 (file)
@@ -37,7 +37,6 @@
 #include <dt_object.h>
 #include <md_object.h>
 #include <lustre_fid.h>
-#include <range_lock.h>
 
 #define OFD_INIT_OBJID 0
 #define OFD_PRECREATE_BATCH_DEFAULT (OBJ_SUBDIR_COUNT * 4)
@@ -188,7 +187,6 @@ struct ofd_object {
        time64_t                ofo_atime_ondisk;
        unsigned int            ofo_pfid_checking:1,
                                ofo_pfid_verified:1;
-       struct range_lock_tree  ofo_write_tree;
 };
 
 static inline struct ofd_object *ofd_obj(struct lu_object *o)
@@ -287,8 +285,6 @@ struct ofd_thread_info {
                struct lfsck_req_local   fti_lrl;
                struct obd_connect_data  fti_ocd;
        };
-       struct range_lock                fti_write_range;
-       unsigned                         fti_range_locked:1;
 };
 
 extern void target_recovery_fini(struct obd_device *obd);
index e6c8991..8b79362 100644 (file)
@@ -689,7 +689,6 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
        enum dt_bufs_type dbt = DT_BUFS_TYPE_WRITE;
        int maxlnb = *nr_local;
        __u64 begin, end;
-       struct range_lock *range = &ofd_info(env)->fti_write_range;
 
        ENTRY;
        LASSERT(env != NULL);
@@ -842,26 +841,6 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
                obj->ioo_bufcnt,
                WRITE);
 
-       /*
-        * Reordering precautions: make sure that request processing that
-        * was able to receive its bulk data should not get reordered with
-        * overlapping BRW requests, e.g.
-        *  1) BRW1 sent, bulk data received, but disk I/O delayed
-        *  2) BRW1 resent and fully processed
-        *  3) the page was unlocked on the client and its writeback bit reset
-        *  4) BRW2 sent and fully processed
-        *  5) BRW1 processing wakes up and writes stale data to disk
-        * If on step 1 bulk data was not received, client resend will invalidate
-        * its bulk descriptor and the RPC will be dropped due to failed bulk
-        * transfer, which is just fine.
-        */
-       range_lock_init(range,
-                       rnb[0].rnb_offset,
-                       rnb[obj->ioo_bufcnt - 1].rnb_offset +
-                       rnb[obj->ioo_bufcnt - 1].rnb_len - 1);
-       range_lock(&fo->ofo_write_tree, range);
-       ofd_info(env)->fti_range_locked = 1;
-
        RETURN(0);
 
 err:
@@ -1234,7 +1213,6 @@ ofd_commitrw_write(const struct lu_env *env, struct obd_export *exp,
        bool soft_sync = false;
        bool cb_registered = false;
        bool fake_write = false;
-       struct range_lock *range = &ofd_info(env)->fti_write_range;
 
        ENTRY;
 
@@ -1399,10 +1377,6 @@ out_stop:
                dt_commit_async(env, ofd->ofd_osd);
 
 out:
-       if (info->fti_range_locked) {
-               range_unlock(&fo->ofo_write_tree, range);
-               info->fti_range_locked = 0;
-       }
        dt_bufs_put(env, o, lnb, niocount);
        ofd_object_put(env, fo);
        if (granted > 0)