Whamcloud - gitweb
LU-1757 osc: clarify short_io_bytes is maximum value 73/33173/3
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 15 Sep 2018 18:39:07 +0000 (12:39 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 12 Oct 2018 23:50:08 +0000 (23:50 +0000)
Clarify in the code that the "osc.*.short_io_bytes" parameter is
the maximum IO size to pack into request/reply not the minimum.

Allow short_io to be disabled completely if it is set to zero.

It would be nice to also change the name of the /proc functions
in a similar manner but that also changes the /proc tunable name
(via LUSTRE_RW_ATTR() macro) and has compatibility implications
for sites that may have changed this value.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3a91420d7e0405445558ba9203233d7f977cab07
Reviewed-on: https://review.whamcloud.com/33173
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/ldlm/ldlm_lib.c
lustre/obdclass/lprocfs_status.c
lustre/osc/osc_request.c

index b35b3fa..78cb375 100644 (file)
@@ -257,9 +257,9 @@ struct client_obd {
        /* just a sum of the loi/lop pending numbers to be exported by /proc */
        atomic_t                cl_pending_w_pages;
        atomic_t                cl_pending_r_pages;
        /* just a sum of the loi/lop pending numbers to be exported by /proc */
        atomic_t                cl_pending_w_pages;
        atomic_t                cl_pending_r_pages;
-       __u32                   cl_max_pages_per_rpc;
-       __u32                   cl_max_rpcs_in_flight;
-       __u32                   cl_short_io_bytes;
+       u32                     cl_max_pages_per_rpc;
+       u32                     cl_max_rpcs_in_flight;
+       u32                     cl_max_short_io_bytes;
        struct obd_histogram    cl_read_rpc_hist;
        struct obd_histogram    cl_write_rpc_hist;
        struct obd_histogram    cl_read_page_hist;
        struct obd_histogram    cl_read_rpc_hist;
        struct obd_histogram    cl_write_rpc_hist;
        struct obd_histogram    cl_read_page_hist;
index 6a5daf7..de66aa3 100644 (file)
@@ -416,7 +416,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         * from OFD after connecting. */
        cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
 
         * from OFD after connecting. */
        cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
 
-       cli->cl_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
+       cli->cl_max_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
 
        /* set cl_chunkbits default value to PAGE_SHIFT,
         * it will be updated at OSC connection time. */
 
        /* set cl_chunkbits default value to PAGE_SHIFT,
         * it will be updated at OSC connection time. */
index e98ca6b..1f064ff 100644 (file)
@@ -2381,7 +2381,7 @@ ssize_t short_io_bytes_show(struct kobject *kobj, struct attribute *attr,
        int rc;
 
        spin_lock(&cli->cl_loi_list_lock);
        int rc;
 
        spin_lock(&cli->cl_loi_list_lock);
-       rc = sprintf(buf, "%d\n", cli->cl_short_io_bytes);
+       rc = sprintf(buf, "%d\n", cli->cl_max_short_io_bytes);
        spin_unlock(&cli->cl_loi_list_lock);
        return rc;
 }
        spin_unlock(&cli->cl_loi_list_lock);
        return rc;
 }
@@ -2405,7 +2405,7 @@ ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr,
        if (rc)
                GOTO(out, rc);
 
        if (rc)
                GOTO(out, rc);
 
-       if (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES)
+       if (val && (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES))
                GOTO(out, rc = -ERANGE);
 
        rc = count;
                GOTO(out, rc = -ERANGE);
 
        rc = count;
@@ -2414,7 +2414,7 @@ ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr,
        if (val > (cli->cl_max_pages_per_rpc << PAGE_SHIFT))
                rc = -ERANGE;
        else
        if (val > (cli->cl_max_pages_per_rpc << PAGE_SHIFT))
                rc = -ERANGE;
        else
-               cli->cl_short_io_bytes = val;
+               cli->cl_max_short_io_bytes = val;
        spin_unlock(&cli->cl_loi_list_lock);
 
 out:
        spin_unlock(&cli->cl_loi_list_lock);
 
 out:
index 3ca65ba..ffa7912 100644 (file)
@@ -1317,9 +1317,9 @@ osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa,
        for (i = 0; i < page_count; i++)
                short_io_size += pga[i]->count;
 
        for (i = 0; i < page_count; i++)
                short_io_size += pga[i]->count;
 
-       /* Check if we can do a short io. */
-       if (!(short_io_size <= cli->cl_short_io_bytes && niocount == 1 &&
-           imp_connect_shortio(cli->cl_import)))
+       /* Check if read/write is small enough to be a short io. */
+       if (short_io_size > cli->cl_max_short_io_bytes || niocount > 1 ||
+           !imp_connect_shortio(cli->cl_import))
                short_io_size = 0;
 
        req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT,
                short_io_size = 0;
 
        req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT,