Whamcloud - gitweb
LU-15252 mdc: add client tunable to disable LSOM update 19/45619/3
authorAlexander Boyko <alexander.boyko@hpe.com>
Fri, 19 Nov 2021 08:08:16 +0000 (03:08 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 13 Dec 2021 03:52:32 +0000 (03:52 +0000)
It seems that mdt_lsom_update() has a serious issue with a single
shared file because of its mdt-level mutex for every close request.
The patch adds mdc_lsom parameter to mdc, base on it state client
sends or not LSOM updates to MDT. By default LSOM is on.

lctl set_param mdc.*.mdc_lsom=[on|off]

For a configuration when LSOM is not used the patch helps
MDT with load avarage with a specific load when many threads
open/read/close for a single file.

HPE-bug-id: LUS-10604
Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
Change-Id: Iba0e745a94825641da6b0a1c09488b1e2f54658b
Reviewed-on: https://review.whamcloud.com/45619
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/mdc/lproc_mdc.c
lustre/mdc/mdc_request.c

index da71340..a2c2a40 100644 (file)
@@ -216,7 +216,8 @@ struct client_obd {
 
        unsigned int             cl_checksum:1, /* 0 = disabled, 1 = enabled */
                                 cl_checksum_dump:1, /* same */
 
        unsigned int             cl_checksum:1, /* 0 = disabled, 1 = enabled */
                                 cl_checksum_dump:1, /* same */
-                                cl_ocd_grant_param:1;
+                                cl_ocd_grant_param:1,
+                                cl_lsom_update:1; /* send LSOM updates */
        enum lustre_sec_part     cl_sp_me;
        enum lustre_sec_part     cl_sp_to;
        struct sptlrpc_flavor    cl_flvr_mgc; /* fixed flavor of mgc->mgs */
        enum lustre_sec_part     cl_sp_me;
        enum lustre_sec_part     cl_sp_to;
        struct sptlrpc_flavor    cl_flvr_mgc; /* fixed flavor of mgc->mgs */
index e48129d..506f06f 100644 (file)
@@ -571,6 +571,34 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file,
 }
 LPROC_SEQ_FOPS(mdc_dom_min_repsize);
 
 }
 LPROC_SEQ_FOPS(mdc_dom_min_repsize);
 
+static int mdc_lsom_seq_show(struct seq_file *m, void *v)
+{
+       struct obd_device *dev = m->private;
+
+       seq_printf(m, "%s\n", dev->u.cli.cl_lsom_update ? "On" : "Off");
+
+       return 0;
+}
+
+static ssize_t mdc_lsom_seq_write(struct file *file,
+                                 const char __user *buffer,
+                                 size_t count, loff_t *off)
+{
+       struct obd_device *dev;
+       bool val;
+       int rc;
+
+       dev =  ((struct seq_file *)file->private_data)->private;
+       rc = kstrtobool_from_user(buffer, count, &val);
+       if (rc)
+               return rc;
+
+       dev->u.cli.cl_lsom_update = val;
+       return count;
+}
+LPROC_SEQ_FOPS(mdc_lsom);
+
+
 LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
 LPROC_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
 LPROC_SEQ_FOPS_RO_TYPE(mdc, timeouts);
 LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
 LPROC_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
 LPROC_SEQ_FOPS_RO_TYPE(mdc, timeouts);
@@ -608,6 +636,8 @@ struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
          .fops =       &mdc_stats_fops                 },
        { .name =       "mdc_dom_min_repsize",
          .fops =       &mdc_dom_min_repsize_fops       },
          .fops =       &mdc_stats_fops                 },
        { .name =       "mdc_dom_min_repsize",
          .fops =       &mdc_dom_min_repsize_fops       },
+       { .name =       "mdc_lsom",
+         .fops =       &mdc_lsom_fops                  },
        { NULL }
 };
 
        { NULL }
 };
 
index 112a834..7eab90d 100644 (file)
@@ -948,7 +948,8 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
         req->rq_request_portal = MDS_READPAGE_PORTAL;
         ptlrpc_at_set_req_timeout(req);
 
         req->rq_request_portal = MDS_READPAGE_PORTAL;
         ptlrpc_at_set_req_timeout(req);
 
-       if (!(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM))
+       if (!obd->u.cli.cl_lsom_update ||
+           !(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM))
                op_data->op_xvalid &= ~(OP_XVALID_LAZYSIZE |
                                        OP_XVALID_LAZYBLOCKS);
 
                op_data->op_xvalid &= ~(OP_XVALID_LAZYSIZE |
                                        OP_XVALID_LAZYBLOCKS);
 
@@ -2830,6 +2831,7 @@ int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
                GOTO(err_osc_cleanup, rc);
 
        obd->u.cli.cl_dom_min_inline_repsize = MDC_DOM_DEF_INLINE_REPSIZE;
                GOTO(err_osc_cleanup, rc);
 
        obd->u.cli.cl_dom_min_inline_repsize = MDC_DOM_DEF_INLINE_REPSIZE;
+       obd->u.cli.cl_lsom_update = true;
 
        ns_register_cancel(obd->obd_namespace, mdc_cancel_weight);
 
 
        ns_register_cancel(obd->obd_namespace, mdc_cancel_weight);