Skip to content

RFC dlm: approach for new lkb reference counting

Alexander Aring gfs2 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11dlm: remove set_master() negative return checkfs/dlm/lock.c+0 -20 replies
2/11dlm: use move_lkb() instead del/add lkbfs/dlm/lock.c+2 -40 replies
3/11dlm: use hold_lkb() instead kref_get()fs/dlm/lock.c+11 -100 replies
4/11dlm: don't track references on move_lkb()fs/dlm/lock.c+15 -60 replies
5/11dlm: drop lkb hold for waiter conversion handlingfs/dlm/lock.c+13 -20 replies
6/11dlm: track reference for lkb_rsb_lookupfs/dlm/lock.c+5 -00 replies
7/11dlm: call queue_cast() on master copy as wellfs/dlm/lock.c+1 -20 replies
8/11dlm: make send dlm message as non-failurefs/dlm/lock.c fs/dlm/lock.h fs/dlm/user.c+86 -1580 replies
9/11dlm: introduce new lkb refcount modelfs/dlm/dlm_internal.h fs/dlm/lock.c+132 -270 replies
10/11dlm: void convert, cancel and unlock requestsfs/dlm/lock.c+12 -250 replies
11/11dlm: return void for _request_lock functionfs/dlm/lock.c+22 -270 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC dlm/next 00/11] dlm: approach for new lkb reference counting

Hi,

this is a new approach to change the lkb refcounting model. The current handling requires to assume that certain return values happen or not, especially for _request_lock() function. However we do it and sometimes don't do it (which requires that certain return values cannot happen). That makes a big headache because we also need to consider recovery handling and state changes inbetween.

The new approach is very tight to the ast handling and in my opinion more robust to not fail, because we would notice earlier if a ast callback will not happen. The lkb lifetime has different states request, convert and unlock. Each of them has different meanings according the ast callback result value and the current lkb lifetime state, e.g. a -EAGAIN on a request will end the lkb lifetime but not on a convert.

Now we require that even master copy call queue_cast() but don't schedule a callback for the user as they are not operating on DLM API user requests. We can now even drop a lot of return value for DLM lock requests that are also called for internal lock request by e.g. recovery as we don't need to evaluate the return value for a potential put(), this is now done on queue_cast().

We also can now check on sanity that requests, converts, cancel/unlock happens on the right lkb lifetime state, e.g. a request cannot happen after a convert or a convert cannot happen after an unlock.

- Alex

Alexander Aring (11):
dlm: remove set_master() negative return check
dlm: use move_lkb() instead del/add lkb
dlm: use hold_lkb() instead kref_get()
dlm: don't track references on move_lkb()
dlm: drop lkb hold for waiter conversion handling
dlm: track reference for lkb_rsb_lookup
dlm: call queue_cast() on master copy as well
dlm: make send dlm message as non-failure
dlm: introduce new lkb refcount model
dlm: void convert, cancel and unlock requests
dlm: return void for _request_lock function

 fs/dlm/dlm_internal.h |  13 ++
 fs/dlm/lock.c         | 522 ++++++++++++++++++++++--------------------
 fs/dlm/lock.h         |   4 +-
 fs/dlm/user.c         |   5 +-
 4 files changed, 290 insertions(+), 254 deletions(-)
Signature · 1 line
2.43.0