Whamcloud - gitweb
LU-13814 osc: reduce queue use in __osc_dio_submit 61/52161/19
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 29 Aug 2023 20:42:38 +0000 (16:42 -0400)
committerPatrick Farrell <pfarrell@whamcloud.com>
Tue, 26 Sep 2023 18:58:30 +0000 (14:58 -0400)
This patch removes another queue use in __osc_dio_submit.

Test-Parameters: fortestonly
Test-Parameters: forjanitoronly
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I6f15d4110291cdca3d3c894916ed3c894f2ad9ce

lustre/osc/osc_io.c

index 20b912b..e27482e 100644 (file)
@@ -274,6 +274,7 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
        unsigned int ppc_bits = cli->cl_chunkbits - PAGE_SHIFT;
        unsigned int max_pages = cli->cl_max_pages_per_rpc;
        unsigned int ppc = 1 << ppc_bits;
+       unsigned int total_queued = 0;
        unsigned int queued = 0;
        bool sync_queue = false;
        int result = 0;
@@ -318,6 +319,7 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
                cl_page_list_move(qout, qin, page);
 
                queued++;
+               total_queued++;
                if (queued == max_pages) {
                        sync_queue = true;
                } else if (crt == CRT_WRITE) {
@@ -354,7 +356,7 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
        }
 
        /* Update c/mtime for sync write. LU-7310 */
-       if (crt == CRT_WRITE && qout->pl_nr > 0 && result == 0) {
+       if (crt == CRT_WRITE && total_queued > 0 && result == 0) {
                struct cl_attr *attr = &osc_env_info(env)->oti_attr;
                struct cl_object *obj   = ios->cis_obj;
 
@@ -364,8 +366,8 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
                cl_object_attr_unlock(obj);
        }
 
-       CDEBUG(D_INFO, "%d/%d %d\n", qin->pl_nr, qout->pl_nr, result);
-       return qout->pl_nr > 0 ? 0 : result;
+       CDEBUG(D_INFO, "%d/%ld %d\n", total_queued, cdp->cdp_count, result);
+       return total_queued > 0 ? 0 : result;
 }
 
 int osc_dio_submit(const struct lu_env *env, struct cl_io *io,