aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/ast.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-10-27 16:45:19 -0400
committerDavid Teigland <teigland@redhat.com>2022-11-08 12:59:41 -0600
commit92e95733307e7b6dd352c12fa174089ed51e7208 (patch)
treebe0513dd02a0ea114adec2095304485c27f2bc20 /fs/dlm/ast.c
parenta4c0352bb1094cbe242f4458e267de845790737a (diff)
downloadlinux-92e95733307e7b6dd352c12fa174089ed51e7208.tar.gz
fs: dlm: use spin lock instead of mutex
There is no need to use a mutex in those hot path sections. We change it to spin lock to serve callbacks more faster by not allowing schedule. The locked sections will not be locked for a long time. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/ast.c')
-rw-r--r--fs/dlm/ast.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index daaa0dff6ef4e..3e76ec75bc555 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -190,7 +190,7 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
return;
}
- mutex_lock(&lkb->lkb_cb_mutex);
+ spin_lock(&lkb->lkb_cb_lock);
prev_seq = lkb->lkb_callbacks[0].seq;
rv = dlm_add_lkb_callback(lkb, flags, mode, status, sbflags, new_seq);
@@ -209,7 +209,7 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
spin_unlock(&ls->ls_cb_lock);
}
out:
- mutex_unlock(&lkb->lkb_cb_mutex);
+ spin_unlock(&lkb->lkb_cb_lock);
}
void dlm_callback_work(struct work_struct *work)
@@ -223,7 +223,7 @@ void dlm_callback_work(struct work_struct *work)
memset(&callbacks, 0, sizeof(callbacks));
- mutex_lock(&lkb->lkb_cb_mutex);
+ spin_lock(&lkb->lkb_cb_lock);
if (!lkb->lkb_callbacks[0].seq) {
/* no callback work exists, shouldn't happen */
log_error(ls, "dlm_callback_work %x no work", lkb->lkb_id);
@@ -244,7 +244,7 @@ void dlm_callback_work(struct work_struct *work)
dlm_print_lkb(lkb);
dlm_dump_lkb_callbacks(lkb);
}
- mutex_unlock(&lkb->lkb_cb_mutex);
+ spin_unlock(&lkb->lkb_cb_lock);
castfn = lkb->lkb_astfn;
bastfn = lkb->lkb_bastfn;