Whamcloud - gitweb
LU-13799 osc: Don't get time for each page 37/39437/13
authorPatrick Farrell <farr0186@gmail.com>
Fri, 7 May 2021 15:35:28 +0000 (11:35 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 30 Jun 2021 15:25:57 +0000 (15:25 +0000)
Getting the time when each batch of pages starts is
sufficiently accurate, and ktime_get() is several % of the
CPU time when doing AIO + DIO.

This relies on previous patches in this series.

Measuring this in milliseconds/gigabyte lets us measure the
improvement in absolute terms, rather than just relative
terms.

This patch reduces i/o time in ms/GiB by:
Write: 17 ms/GiB
Read: 6 ms/GiB

Totals:
Write: 237 ms/GiB
Read: 223 ms/GiB

IOR:
mpirun -np 1  $IOR -w -r -t 64M -b 64G -o ./iorfile --posix.odirect
Without the patch:
write     4030 MiB/s
read      4468  MiB/s

With patch:
write     4326 MiB/s
read      4587 MiB/s

Signed-off-by: Patrick Farrell <farr0186@gmail.com>
Change-Id: I02897bf810683bc77a7d09156cdb83ba1d25ebf1
Reviewed-on: https://review.whamcloud.com/39437
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre_osc.h
lustre/osc/osc_io.c
lustre/osc/osc_page.c

index 0341e13..793c493 100644 (file)
@@ -571,7 +571,7 @@ void osc_index2policy(union ldlm_policy_data *policy, const struct cl_object *ob
                      pgoff_t start, pgoff_t end);
 void osc_lru_add_batch(struct client_obd *cli, struct list_head *list);
 void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
-                    enum cl_req_type crt, int brw_flags);
+                    enum cl_req_type crt, int brw_flags, ktime_t submit_time);
 int lru_queue_work(const struct lu_env *env, void *data);
 long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli,
                    long target, bool force);
index 07f45bf..88069c2 100644 (file)
@@ -132,6 +132,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
        unsigned int max_pages;
        unsigned int ppc_bits; /* pages per chunk bits */
        unsigned int ppc;
+       ktime_t submit_time = ktime_get();
        bool sync_queue = false;
 
        LASSERT(qin->pl_nr > 0);
@@ -195,7 +196,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
                oap->oap_async_flags |= ASYNC_COUNT_STABLE;
                spin_unlock(&oap->oap_lock);
 
-               osc_page_submit(env, opg, crt, brw_flags);
+               osc_page_submit(env, opg, crt, brw_flags, submit_time);
                list_add_tail(&oap->oap_pending_item, &list);
 
                if (page->cp_sync_io != NULL)
index 2a57cf0..320c1c6 100644 (file)
@@ -299,7 +299,7 @@ EXPORT_SYMBOL(osc_page_init);
  * transfer (i.e., transferred synchronously).
  */
 void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
-                    enum cl_req_type crt, int brw_flags)
+                    enum cl_req_type crt, int brw_flags, ktime_t submit_time)
 {
        struct osc_io *oio = osc_env_io(env);
        struct osc_async_page *oap = &opg->ops_oap;
@@ -319,7 +319,7 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
                oap->oap_cmd |= OBD_BRW_NOQUOTA;
        }
 
-       opg->ops_submit_time = ktime_get();
+       opg->ops_submit_time = submit_time;
        osc_page_transfer_get(opg, "transfer\0imm");
        osc_page_transfer_add(env, opg, crt);
 }