From 4f3ff10ce10a9c1933544d65513eaf0ea080b93e Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 29 Aug 2023 16:42:38 -0400 Subject: [PATCH] LU-13814 osc: reduce queue use in __osc_dio_submit This patch removes another queue use in __osc_dio_submit. Test-Parameters: fortestonly Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: I6f15d4110291cdca3d3c894916ed3c894f2ad9ce --- lustre/osc/osc_io.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 20b912b..e27482e 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -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, -- 1.8.3.1