[Ocfs2-commits] mfasheh commits r2370 - trunk/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Jun 6 18:17:02 CDT 2005


Author: mfasheh
Signed-off-by: khackel
Date: 2005-06-06 18:17:00 -0500 (Mon, 06 Jun 2005)
New Revision: 2370

Modified:
   trunk/fs/ocfs2/dlm/dlmdomain.c
Log:
* use msleep instead of schedule for backoff during domain events

Signed-off-by: khackel



Modified: trunk/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.c	2005-06-06 17:40:24 UTC (rev 2369)
+++ trunk/fs/ocfs2/dlm/dlmdomain.c	2005-06-06 23:17:00 UTC (rev 2370)
@@ -31,8 +31,8 @@
 #include <linux/utsname.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
+#include <linux/delay.h>
 
-
 #include "cluster/heartbeat.h"
 #include "cluster/nodemanager.h"
 #include "cluster/tcp.h"
@@ -65,6 +65,8 @@
 LIST_HEAD(dlm_domains);
 static DECLARE_WAIT_QUEUE_HEAD(dlm_domain_events);
 
+#define DLM_DOMAIN_BACKOFF_MS 200
+
 static int dlm_query_join_handler(o2net_msg *msg, u32 len, void *data);
 static int dlm_assert_joined_handler(o2net_msg *msg, u32 len, void *data);
 static int dlm_cancel_join_handler(o2net_msg *msg, u32 len, void *data);
@@ -485,7 +487,7 @@
 			/* Not sure what to do here but lets sleep for
 			 * a bit in case this was a transient
 			 * error... */
-			schedule();
+			msleep(DLM_DOMAIN_BACKOFF_MS);
 			clear_node = 0;
 		}
 
@@ -824,7 +826,7 @@
 
 				/* give us some time between errors... */
 				if (live)
-					schedule();
+					msleep(DLM_DOMAIN_BACKOFF_MS);
 			}
 		} while (status && live);
 	}
@@ -1070,7 +1072,6 @@
 	if (status)
 		goto bail;
 
-
 bail:
 	if (status)
 		dlm_unregister_domain_handlers(dlm);
@@ -1092,16 +1093,12 @@
 		goto bail;
 	}
 
-
-
 	status = dlm_launch_thread(dlm);
 	if (status < 0) {
 		mlog_errno(status);
 		goto bail;
 	}
 
-
-
 	do {
 		status = dlm_try_to_join_domain(dlm);
 
@@ -1109,12 +1106,12 @@
 		 * need to back off temporarily and let them
 		 * complete. */
 		if (status == -EAGAIN) {
-			schedule();
-
 			if (signal_pending(current)) {
 				status = -ERESTARTSYS;
 				goto bail;
 			}
+
+			msleep(DLM_DOMAIN_BACKOFF_MS);
 		}
 	} while (status == -EAGAIN);
 
@@ -1129,7 +1126,6 @@
 		goto bail;
 	}
 
-
 	spin_lock(&dlm_domain_lock);
 	dlm->num_joins++;
 	dlm->dlm_state = DLM_CTXT_JOINED;



More information about the Ocfs2-commits mailing list