Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519221

[PATCH 25/35] staging: lustre: osc: Do not merge extents with partial pages

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 25/35] staging: lustre: osc: Do not merge extents with partial pages
Date 2016-11-10 18:40 +0100
Message-ID <sC1us-MX-111@gated-at.bofh.it> (permalink)
References <sC1up-MX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jinshan Xiong <jinshan.xiong@intel.com>

After range lock is introduced to Lustre, it's possible for
multiple threads to submit osc_extents with partial pages, and
finally I/O engine may try to merge these extents, which will
end up with assert in osc_build_rpc().

In this patch, osc_extent::oe_no_merge is introduced, and this flag
is set if osc_extent submitted via osc_io_submit() includes partial
pages. This flag is used by I/O engine to stop merging this kind
of extents.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6666
Reviewed-on: http://review.whamcloud.com/15468
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c      |   11 +++++++++--
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |    4 ++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 0ca01b1..b0f030c 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1918,7 +1918,8 @@ static int try_to_add_extent_for_io(struct client_obd *cli,
 		}
 
 		if (tmp->oe_srvlock != ext->oe_srvlock ||
-		    !tmp->oe_grants != !ext->oe_grants)
+		    !tmp->oe_grants != !ext->oe_grants ||
+		    tmp->oe_no_merge || ext->oe_no_merge)
 			return 0;
 
 		/* remove break for strict check */
@@ -2649,11 +2650,13 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
 	struct osc_async_page *oap, *tmp;
 	int page_count = 0;
 	int mppr = cli->cl_max_pages_per_rpc;
+	bool can_merge = true;
 	pgoff_t start = CL_PAGE_EOF;
 	pgoff_t end = 0;
 
 	list_for_each_entry(oap, list, oap_pending_item) {
-		pgoff_t index = osc_index(oap2osc(oap));
+		struct osc_page *opg = oap2osc_page(oap);
+		pgoff_t index = osc_index(opg);
 
 		if (index > end)
 			end = index;
@@ -2661,6 +2664,9 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
 			start = index;
 		++page_count;
 		mppr <<= (page_count > mppr);
+
+		if (unlikely(opg->ops_from > 0 || opg->ops_to < PAGE_SIZE))
+			can_merge = false;
 	}
 
 	ext = osc_extent_alloc(obj);
@@ -2674,6 +2680,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
 
 	ext->oe_rw = !!(cmd & OBD_BRW_READ);
 	ext->oe_sync = 1;
+	ext->oe_no_merge = !can_merge;
 	ext->oe_urgent = 1;
 	ext->oe_start = start;
 	ext->oe_end = end;
diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
index e525110..e4a214d 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
+++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
@@ -596,6 +596,10 @@ struct osc_extent {
 			   oe_rw:1,
 	/** sync extent, queued by osc_queue_sync_pages() */
 				oe_sync:1,
+	/** set if this extent has partial, sync pages.
+	 * Extents with partial page(s) can't merge with others in RPC
+	 */
+				oe_no_merge:1,
 			   oe_srvlock:1,
 			   oe_memalloc:1,
 	/** an ACTIVE extent is going to be truncated, so when this extent
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/35] second batch of missing lustre 2.8 patches James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 04/35] staging: lustre: lov: init LOV stripe type beforehand James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 31/35] staging: lustre: obdclass: add export for lprocfs_stats_alloc_one() James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 30/35] staging: lustre: llite: ll_write_begin/end not passing on errors James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 14/35] staging: lustre: nrs: serialize executions of nrs_policy_stop James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 19/35] staging: lustre: obdclass: remove structure holes to reduce memory James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 15/35] staging: lustre: llite: tar restore fails for HSM released files. James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 20/35] staging: lustre: ptlrpc: Move IT_* definitions to lustre_idl.h James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 26/35] staging: lustre: mdc: remove console spew from mdc_ioc_fid2path James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 35/35] staging: lustre: idl: clean up file attribute flags James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 22/35] staging: lustre: llite: clear dir stripe md in ll_iget James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 01/35] staging: lustre: hsm: Use file lease to implement migration James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 10/35] staging: lustre: lmv: revalidate the dentry for striped dir James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 28/35] staging: lustre: osc: Remove remains of osc_ast_guard James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 03/35] staging: lustre: ptlrpc: mbits is sent within ptlrpc_body James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 27/35] staging: lustre: ptlrpc: reset imp_replay_cursor James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 25/35] staging: lustre: osc: Do not merge extents with partial pages James Simmons <jsimmons@infradead.org> - 2016-11-10 18:40 +0100
  [PATCH 16/35] staging: lustre: llite: support SELinux context labelling James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 11/35] staging: lustre: ptlrpc: race at req processing James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 06/35] staging: lustre: osc: Performance tune for LRU James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 17/35] staging: lustre: obd: Remove dead code in precleanup James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 13/35] staging: lustre: llite: lookup master inode by ilookup5_nowait James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 18/35] staging: lustre: osc: fix max_dirty_mb tunable setting limit James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 24/35] staging: lustre: osc: osc_extent should hold refcount to osc_object James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 23/35] staging: lustre: ldlm: improve lock timeout messages James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 05/35] staging: lustre: llog: fix wrong offset in llog_process_thread() James Simmons <jsimmons@infradead.org> - 2016-11-10 18:50 +0100
  [PATCH 02/35] staging: lustre: obd: rename obd_unpackmd() to md_unpackmd() James Simmons <jsimmons@infradead.org> - 2016-11-10 19:10 +0100
  [PATCH 07/35] staging: lustre: lov: avoid infinite loop in lsm_alloc_plain() James Simmons <jsimmons@infradead.org> - 2016-11-10 19:10 +0100
  [PATCH 09/35] staging: lustre: mgc: IR log failure should not stop mount James Simmons <jsimmons@infradead.org> - 2016-11-10 19:10 +0100

csiph-web