Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbcKGBzb (ORCPT ); Sun, 6 Nov 2016 20:55:31 -0500 Received: from casper.infradead.org ([85.118.1.10]:56640 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbcKGBzX (ORCPT ); Sun, 6 Nov 2016 20:55:23 -0500 Date: Mon, 7 Nov 2016 01:55:21 +0000 (GMT) From: James Simmons To: Oleg Drokin cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Linux Kernel Mailing List , Lustre Development List , Hongchao Zhang Subject: Re: [PATCH 08/14] staging/lustre/ldlm: engage ELC for all ldlm enqueue req In-Reply-To: <1478136304-867780-9-git-send-email-green@linuxhacker.ru> Message-ID: References: <1478136304-867780-1-git-send-email-green@linuxhacker.ru> <1478136304-867780-9-git-send-email-green@linuxhacker.ru> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161107_015521_209732_F4345B11 X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2413 Lines: 67 > From: Hongchao Zhang > > If there is no request passed into ldlm_cli_enqueue, the enqueue > request will not engage ELC to drop unneeded locks. currently, > this kind of request is mainly related to EXTENT locks enqueue > requests (except for glimpse EXTENT lock for it has an intent). Reviewed-by: James Simmons > Signed-off-by: Hongchao Zhang > Reviewed-on: http://review.whamcloud.com/21739 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8209 > Reviewed-by: Andreas Dilger > Reviewed-by: Vitaly Fertman > Signed-off-by: Oleg Drokin > --- > drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 21 ++++----------------- > 1 file changed, 4 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c > index 1b9ae77..c5d00d1 100644 > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c > @@ -748,17 +748,14 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, > lock->l_last_activity = ktime_get_real_seconds(); > > /* lock not sent to server yet */ > - > if (!reqp || !*reqp) { > - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), > - &RQF_LDLM_ENQUEUE, > - LUSTRE_DLM_VERSION, > - LDLM_ENQUEUE); > - if (!req) { > + req = ldlm_enqueue_pack(exp, lvb_len); > + if (IS_ERR(req)) { > failed_lock_cleanup(ns, lock, einfo->ei_mode); > LDLM_LOCK_RELEASE(lock); > - return -ENOMEM; > + return PTR_ERR(req); > } > + > req_passed_in = 0; > if (reqp) > *reqp = req; > @@ -778,16 +775,6 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, > body->lock_flags = ldlm_flags_to_wire(*flags); > body->lock_handle[0] = *lockh; > > - /* Continue as normal. */ > - if (!req_passed_in) { > - if (lvb_len > 0) > - req_capsule_extend(&req->rq_pill, > - &RQF_LDLM_ENQUEUE_LVB); > - req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, > - lvb_len); > - ptlrpc_request_set_replen(req); > - } > - > /* > * Liblustre client doesn't get extent locks, except for O_APPEND case > * where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where > -- > 2.7.4 > >