From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [DLM PATCH] DLM: Add some cond_resched statements to recovery
Date: Wed, 21 Jun 2017 09:53:46 -0400 (EDT) [thread overview]
Message-ID: <2043827461.25010063.1498053226221.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <677067416.25007844.1498053141886.JavaMail.zimbra@redhat.com>
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 <rpeterso@redhat.com>
---
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)
parent reply other threads:[~2017-06-21 13:53 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <677067416.25007844.1498053141886.JavaMail.zimbra@redhat.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2043827461.25010063.1498053226221.JavaMail.zimbra@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.