dlm: drop dlm_scand kthread and use timers
authorAlexander Aring <aahringo@redhat.com>
Mon, 15 Apr 2024 18:39:41 +0000 (14:39 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 16 Apr 2024 19:40:27 +0000 (14:40 -0500)
commitb1f2381c1a8d52b973944090ed8b42c750152533
treeefc6ae5b11b6cce09887c967ff392c0247834fdb
parent6644925abf056030cd9efc73fc05ea5a5df4f59f
dlm: drop dlm_scand kthread and use timers

Currently the scand kthread acts like a garbage collection for expired
rsbs on toss list, to clean them up after a certain timeout. It triggers
every couple of seconds and iterates over the toss list while holding
ls_rsbtbl_lock for the whole hash bucket iteration.

To reduce the amount of time holding ls_rsbtbl_lock, we now handle the
disposal of expired rsbs using a per-lockspace timer that expires for the
earliest tossed rsb on the lockspace toss queue. This toss queue is
ordered according to the rsb res_toss_time with the earliest tossed rsb
as the first entry. The toss timer will only trylock() necessary locks,
since it is low priority garbage collection, and will rearm the timer
if trylock() fails. If the timer function does not find any expired
rsb's, it rearms the timer with the next earliest expired rsb.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/dlm_internal.h
fs/dlm/lock.c
fs/dlm/lock.h
fs/dlm/lockspace.c
fs/dlm/member.c
fs/dlm/recover.c
fs/dlm/recoverd.c