From 9f6c9fa44d6e65e26b857a45a1c1ddcda5529ff9 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Fri, 14 Feb 2020 14:50:11 +0800 Subject: [PATCH] LU-13180 osc: disable ext merging for rdma only pages and non-rdma This patch try to add logic to prevent CPU memory pages and RDMA memory pages from merging into one RPC, codes which set OBD_BRW_RDMA_ONLY will be added whenever RDMA only codes added later. Change-Id: I11e8beda52cc533f17b2a40c34713f441e93d5b6 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/37567 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Gu Zheng Reviewed-by: Yingjin Qian --- lustre/include/lustre_osc.h | 4 +++- lustre/osc/osc_cache.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index b8cadb7..bd2bcff 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -922,7 +922,9 @@ struct osc_extent { /** Non-delay RPC should be used for this extent. */ oe_ndelay:1, /** direct IO pages */ - oe_dio:1; + oe_dio:1, + /** this extent consists of RDMA only pages */ + oe_is_rdma_only; /** how many grants allocated for this extent. * Grant allocated for this extent. There is no grant allocated * for reading extents and sync write extents. */ diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index e0c9901..e2b971d6 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -1851,6 +1851,9 @@ can_merge(const struct osc_extent *ext, const struct osc_extent *in_rpc) if (in_rpc->oe_dio && overlapped(ext, in_rpc)) return false; + if (ext->oe_is_rdma_only != in_rpc->oe_is_rdma_only) + return false; + return true; } @@ -2606,6 +2609,7 @@ int osc_queue_sync_pages(const struct lu_env *env, const struct cl_io *io, ext->oe_srvlock = !!(brw_flags & OBD_BRW_SRVLOCK); ext->oe_ndelay = !!(brw_flags & OBD_BRW_NDELAY); ext->oe_dio = !!(brw_flags & OBD_BRW_NOCACHE); + ext->oe_is_rdma_only = !!(brw_flags & OBD_BRW_RDMA_ONLY); ext->oe_nr_pages = page_count; ext->oe_mppr = mppr; list_splice_init(list, &ext->oe_pages); -- 1.8.3.1