Whamcloud - gitweb
LU-13814 osc: reduce queue use in __osc_dio_submit 61/52161/33
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 28 Apr 2025 15:41:31 +0000 (11:41 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Jun 2025 22:53:57 +0000 (22:53 +0000)
This patch removes another queue use in __osc_dio_submit.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I6f15d4110291cdca3d3c894916ed3c894f2ad9ce
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52161
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Marc Vef <mvef@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osc/osc_io.c

index 0b598f9..4f9ecd0 100644 (file)
@@ -257,6 +257,7 @@ static 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;
@@ -301,6 +302,7 @@ static 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) {
@@ -337,7 +339,7 @@ static 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;
 
@@ -347,8 +349,9 @@ static 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/%u %d\n", total_queued, cdp->cdp_page_count,
+              result);
+       return total_queued > 0 ? 0 : result;
 }
 
 int osc_dio_submit(const struct lu_env *env, struct cl_io *io,