DLM: Add some cond_resched statements to recovery
PATCH 1/1 DLM: Add some cond_resched statements to recovery
In reply to a message not in the archiveHi,
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 <[email protected]>
--- fs/dlm/lock.c | 2 ++ fs/dlm/recover.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
fs/dlm/lock.c +2 -0
@@ -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 (); } }
fs/dlm/recover.c +4 -1
@@ -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)