From: Patrick Farrell Date: Mon, 28 Apr 2025 15:41:31 +0000 (-0400) Subject: LU-13814 osc: reduce queue use in __osc_dio_submit X-Git-Tag: 2.16.56~30 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=14575563dea23fbb3417b64fd164cbc3da866469;p=fs%2Flustre-release.git LU-13814 osc: reduce queue use in __osc_dio_submit This patch removes another queue use in __osc_dio_submit. Signed-off-by: Patrick Farrell Change-Id: I6f15d4110291cdca3d3c894916ed3c894f2ad9ce Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52161 Reviewed-by: Andreas Dilger Reviewed-by: Marc Vef Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 0b598f9..4f9ecd0 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -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,