From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 21 Jun 2017 09:53:46 -0400 (EDT) Subject: [Cluster-devel] [DLM PATCH] DLM: Add some cond_resched statements to recovery In-Reply-To: <677067416.25007844.1498053141886.JavaMail.zimbra@redhat.com> Message-ID: <2043827461.25010063.1498053226221.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, This patch adds some cond_resched statements to dlm's recovery process to allow other processes to run, such as corosync. Signed-off-by: Bob Peterson --- fs/dlm/lock.c | 2 ++ fs/dlm/recover.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index d4aadde..da28be8 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1736,6 +1736,7 @@ static void shrink_bucket(struct dlm_ls *ls, int b) */ for (i = 0; i < remote_count; i++) { + cond_resched(); name = ls->ls_remove_names[i]; len = ls->ls_remove_lens[i]; @@ -1914,6 +1915,7 @@ void dlm_scan_timeout(struct dlm_ls *ls) unlock_rsb(r); unhold_rsb(r); dlm_put_lkb(lkb); + cond_resched(); } } diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c index eaea789..3346971 100644 --- a/fs/dlm/recover.c +++ b/fs/dlm/recover.c @@ -23,7 +23,6 @@ #include "member.h" #include "recover.h" - /* * Recovery waiting routines: these functions wait for a particular reply from * a remote node, or for the remote node to report a certain status. They need @@ -651,6 +650,7 @@ static int recover_locks(struct dlm_rsb *r) rsb_clear_flag(r, RSB_NEW_MASTER); out: unlock_rsb(r); + cond_resched(); return error; } @@ -879,6 +879,7 @@ void dlm_recover_rsbs(struct dlm_ls *ls) rsb_clear_flag(r, RSB_RECOVER_LVB_INVAL); rsb_clear_flag(r, RSB_NEW_MASTER2); unlock_rsb(r); + cond_resched(); } up_read(&ls->ls_root_sem); @@ -912,6 +913,7 @@ int dlm_create_root_list(struct dlm_ls *ls) if (!RB_EMPTY_ROOT(&ls->ls_rsbtbl[i].toss)) log_error(ls, "dlm_create_root_list toss not empty"); spin_unlock(&ls->ls_rsbtbl[i].lock); + cond_resched(); } out: up_write(&ls->ls_root_sem); @@ -947,6 +949,7 @@ void dlm_clear_toss(struct dlm_ls *ls) count++; } spin_unlock(&ls->ls_rsbtbl[i].lock); + cond_resched(); } if (count)