From: Hongchao Zhang Date: Wed, 26 Jun 2024 06:56:26 +0000 (+0800) Subject: LU-17272 osc: check cl_dirty_max_pages X-Git-Tag: 2.15.90~66 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=94d1241342749c1d2f411f1c4f8d8ef4259efb5f;p=fs%2Flustre-release.git LU-17272 osc: check cl_dirty_max_pages In osc_queue_sync_pages, the client_obd->cl_dirty_max_pages should also be checked along with the grant check. Signed-off-by: Hongchao Zhang Change-Id: I3d22fdcf6d8ea99b48bc1f42e7b686ab4ba0e1f0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53037 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index c4c13f4..b884c00 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -2611,7 +2611,9 @@ int osc_queue_sync_pages(const struct lu_env *env, struct cl_io *io, CDEBUG(D_CACHE, "requesting %d bytes grant\n", grants); spin_lock(&cli->cl_loi_list_lock); - if (osc_reserve_grant(cli, grants) == 0) { + if (osc_reserve_grant(cli, grants) == 0 && + cli->cl_dirty_pages + page_count < + cli->cl_dirty_max_pages) { list_for_each_entry(oap, list, oap_pending_item) { osc_consume_write_grant(cli, &oap->oap_brw_page); @@ -2622,12 +2624,12 @@ int osc_queue_sync_pages(const struct lu_env *env, struct cl_io *io, } else { /* We cannot report ENOSPC correctly if we do parallel * DIO (async RPC submission), so turn off parallel dio - * if there is not sufficient grant available. This - * makes individual RPCs synchronous. + * if there is not sufficient grant or dirty pages + * available. This makes individual RPCs synchronous. */ io->ci_parallel_dio = false; CDEBUG(D_CACHE, - "not enough grant available, switching to sync for this i/o\n"); + "not enough grant or dirty pages available, switching to sync for this i/o\n"); } spin_unlock(&cli->cl_loi_list_lock); osc_update_next_shrink(cli);