From b9ebb17277c78101018a0cf4a63f6beb93b9baf0 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Fri, 10 Aug 2018 16:18:48 +0300 Subject: [PATCH] LU-11296 osc: speed up page cache cleanup during blocking ASTs While we are cleaning a write lock, we don't need to check if page cache pages under this lock are covered by another lock. If a client needs to give up its lock, cleaning gigabytes of page cache can take quite a long time. Signed-off-by: Andrew Perepechko Cray-bug-id: LUS-6352 Change-Id: I576130216ed4de4e352ea697bddb5ff83046443a Reviewed-by: Patrick Farrell Reviewed-by: Alexander Zarochentsev Reviewed-on: https://review.whamcloud.com/33090 Reviewed-by: Jinshan Xiong Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/osc/osc_lock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index b2042a4..dca41e4 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -377,7 +377,12 @@ static int osc_lock_flush(struct osc_object *obj, pgoff_t start, pgoff_t end, rc = 0; } - rc2 = osc_lock_discard_pages(env, obj, start, end, discard); + /* + * Do not try to match other locks with CLM_WRITE since we already + * know there're none + */ + rc2 = osc_lock_discard_pages(env, obj, start, end, + mode == CLM_WRITE || discard); if (rc == 0 && rc2 < 0) rc = rc2; -- 1.8.3.1