public inbox for gfs2@lists.linux.dev
 help / color / mirror / Atom feed
* [RFC dlm/next 00/11] dlm: approach for new lkb reference counting
@ 2024-11-07 20:46 Alexander Aring
  2024-11-07 20:46 ` [RFC dlm/next 01/11] dlm: remove set_master() negative return check Alexander Aring
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Alexander Aring @ 2024-11-07 20:46 UTC (permalink / raw)
  To: teigland; +Cc: gfs2, aahringo

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-11-07 20:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 20:46 [RFC dlm/next 00/11] dlm: approach for new lkb reference counting Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 01/11] dlm: remove set_master() negative return check Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 02/11] dlm: use move_lkb() instead del/add lkb Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 03/11] dlm: use hold_lkb() instead kref_get() Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 04/11] dlm: don't track references on move_lkb() Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 05/11] dlm: drop lkb hold for waiter conversion handling Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 06/11] dlm: track reference for lkb_rsb_lookup Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 07/11] dlm: call queue_cast() on master copy as well Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 08/11] dlm: make send dlm message as non-failure Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 09/11] dlm: introduce new lkb refcount model Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 10/11] dlm: void convert, cancel and unlock requests Alexander Aring
2024-11-07 20:46 ` [RFC dlm/next 11/11] dlm: return void for _request_lock function Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox