[LU-8209] glimpse lock request does not engage ELC to drop unneeded locks Created: 26/May/16  Updated: 21/Dec/18  Resolved: 08/Oct/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Major
Reporter: Oleg Drokin Assignee: Hongchao Zhang
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6529 Server side lock limits to avoid unne... Closed
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It appears that with conversion to clio this important bit of funcionality that allows us to balance lock counts on clients was lost.

Vitaly tracked it to this patch:

commit fd908da92ccd9aab4ffc3d2463301831260c0474
Author: huanghua <huanghua>
Date:   Thu Feb 7 08:07:16 2008 +0000

    b=14149
    i=yong.fan
    i=rahul.deshmukh
    i=nikita.danilov
    
    - use req_capsule interface for client.
    - add some interoperability support on server side.

The removal seems to be accidental.
Where before all enqueues came via a single path and ELC was alwas engaged, this is no longer the case.
The patch was cli_enqueue() -> ldlm_prep_enqueue_req()
and this call to ldlm_prep_enqueue_req() is now missing for glimpse enqueue.



 Comments   
Comment by Bruno Faccini (Inactive) [ 27/May/16 ]

Well, if I correctly understand, this means that presently in current master, ldlm_cli_enqueue() does not call ldlm_prep_[enqueue,elc]_req() but this is left to upper layer/callers responsibility to track for/submit eligible locks, right?

Based on this now, my understanding is that :
_ Client glimpse enqueue seems to start with cl_glimpse_lock(), calling cl_lock_request() with CEF_ASYNC flag set in cl_lock_descr struct. CEF_MUST flag is also set to ensure lock request will be issued and not be considered as lock-less.
_ cl_lock_request() will first call cl_lock_init()
_ cl_lock_init() will call ::coo_lock_init method() for each layer
_ thus osc_lock_init() will be called and will set LDLM_FL_HAS_INTENT flag due to CEF_ASYNC present (with help from osc_enq2ldlm_flags()), and will also set ols_glimpse bit
_ back in cl_lock _request(), it will then call cl_lock_enqueue()
_ cl_lock_enqueue() will call ::clo_enqueue() method for each layer, and thus osc_lock_enqueue() will be called
_ osc_lock_enqueue() will call osc_enqueue_base(), because ols_glimpse bit and not lock-less
_ osc_enqueue_base() will call ldlm_prep_enqueue_req() because of LDLM_FL_HAS_INTENT is set

What do you think? Did I miss something there ?

Comment by Vitaly Fertman [ 05/Jul/16 ]

err... the opposite. the glimpse works fine. others are not, because of:

@@ -646,7 +650,10 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
         /* lock not sent to server yet */
 
         if (reqp == NULL || *reqp == NULL) {
-                req = ldlm_prep_enqueue_req(exp, 2, size, NULL, 0);
+                req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
+                                                &RQF_LDLM_ENQUEUE,
+                                                LUSTRE_DLM_VERSION,
+                                                LDLM_ENQUEUE);
                 if (req == NULL) {
                         failed_lock_cleanup(ns, lock, lockh, einfo->ei_mode);
                         LDLM_LOCK_PUT(lock);
Comment by Gerrit Updater [ 05/Aug/16 ]

Hongchao Zhang (hongchao.zhang@intel.com) uploaded a new patch: http://review.whamcloud.com/21739
Subject: LU-8209 ldlm: engage ELC for all ldlm enqueue req
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ab97c207d6310426d6872d2fa234ad4ed5dfeebb

Comment by Gerrit Updater [ 08/Oct/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/21739/
Subject: LU-8209 ldlm: engage ELC for all ldlm enqueue req
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e8f5f496ed41f237c4fb44cc7355f1ded4c33ac6

Comment by Peter Jones [ 08/Oct/16 ]

Landed for 2.9

Generated at Sat Feb 10 02:15:34 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.