From 50c8a8cfaa819e3995a531adac02c56bc726135d Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Sun, 24 Sep 2023 17:00:52 -0400 Subject: [PATCH] LU-13814 clio: remove last DIO queue usage With cleanup of osc_dio_submit, we can remove the horrid 'convert to queue' function which converts the cl_dio_pages array to a cl2queue. There's still a lot left to do to remove cl_pages for DIO, but this is a nice step. Test-Parameters: fortestonly Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: I4a67cbe8c5e5a3961f5afc593ad0261cb903eabe --- lustre/include/cl_object.h | 2 -- lustre/obdclass/cl_io.c | 14 -------------- lustre/osc/osc_io.c | 38 ++++---------------------------------- 3 files changed, 4 insertions(+), 50 deletions(-) diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index 68bcc00..2d84e09 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2558,7 +2558,6 @@ void cl_sync_io_note(const struct lu_env *env, struct cl_sync_io *anchor, int ioret); int cl_sync_io_wait_recycle(const struct lu_env *env, struct cl_sync_io *anchor, long timeout, int ioret); -void cl_dio_pages_2queue(struct cl_dio_pages *ldp); struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj, bool is_aio); struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, @@ -2602,7 +2601,6 @@ struct cl_dio_pages { struct cl_page **cdp_cl_pages; struct cl_sync_io *cdp_sync_io; - struct cl_2queue cdp_queue; /** # of pages in the array. */ size_t cdp_count; /* the file offset of the first page. */ diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index ffe351b..f2d9da2 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -1209,20 +1209,6 @@ static inline void dio_aio_complete(struct kiocb *iocb, ssize_t res) #endif } -void cl_dio_pages_2queue(struct cl_dio_pages *cdp) -{ - int i = 0; - - cl_2queue_init(&cdp->cdp_queue); - - for (i = 0; i < cdp->cdp_count; i++) { - struct cl_page *page = cdp->cdp_cl_pages[i]; - - cl_page_list_add(&cdp->cdp_queue.c2_qin, page, false); - } -} -EXPORT_SYMBOL(cl_dio_pages_2queue); - static void cl_dio_aio_end(const struct lu_env *env, struct cl_sync_io *anchor) { struct cl_dio_aio *aio = container_of(anchor, typeof(*aio), cda_sync); diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index e27482e..4f4d155 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -259,12 +259,10 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io, } EXPORT_SYMBOL(osc_io_submit); -int __osc_dio_submit(const struct lu_env *env, struct cl_io *io, - const struct cl_io_slice *ios, enum cl_req_type crt, - struct cl_dio_pages *cdp, struct cl_2queue *queue) +int osc_dio_submit(const struct lu_env *env, struct cl_io *io, + const struct cl_io_slice *ios, enum cl_req_type crt, + struct cl_dio_pages *cdp) { - struct cl_page_list *qout = &queue->c2_qout; - struct cl_page_list *qin = &queue->c2_qin; struct osc_object *osc = cl2osc(ios->cis_obj); struct cl_io *top_io = cl_io_top(io); struct client_obd *cli = osc_cli(osc); @@ -283,9 +281,7 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io, int to = -1; int i = 0; - LASSERT(qin->pl_nr > 0); - - CDEBUG(D_CACHE|D_READA, "%d %d\n", qin->pl_nr, crt); + CDEBUG(D_CACHE|D_READA, "%ld %d\n", cdp->cdp_count, crt); brw_flags = osc_io_srvlock(cl2osc_io(env, ios)) ? OBD_BRW_SRVLOCK : 0; brw_flags |= crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ; @@ -316,8 +312,6 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io, osc_page_submit(env, opg, crt, brw_flags); list_add_tail(&oap->oap_pending_item, &list); - cl_page_list_move(qout, qin, page); - queued++; total_queued++; if (queued == max_pages) { @@ -369,30 +363,6 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io, 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, - const struct cl_io_slice *ios, enum cl_req_type crt, - struct cl_dio_pages *cdp) -{ - struct cl_2queue *queue; - int rc = 0; - - cl_dio_pages_2queue(cdp); - queue = &cdp->cdp_queue; - - rc = __osc_dio_submit(env, io, ios, crt, cdp, queue); - - /* if submit failed, no pages were sent */ - LASSERT(ergo(rc != 0, list_empty(&queue->c2_qout.pl_pages))); - while (queue->c2_qout.pl_nr > 0) { - struct cl_page *page; - - page = cl_page_list_first(&queue->c2_qout); - cl_page_list_del(env, &queue->c2_qout, page, false); - } - - RETURN(rc); -} EXPORT_SYMBOL(osc_dio_submit); /** -- 1.8.3.1