[Ocfs2-commits] mfasheh commits r2203 - in trunk/fs/ocfs2: . cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Apr 29 17:42:12 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-29 17:42:10 -0500 (Fri, 29 Apr 2005)
New Revision: 2203

Modified:
   trunk/fs/ocfs2/cluster/heartbeat.c
   trunk/fs/ocfs2/journal.c
   trunk/fs/ocfs2/vote.c
Log:
* Have our kernel threads do interruptible sleeps even though they block
  signals. This doesn't have any actual effect on things other than to make
  the load average calculation not freak out. Quoth the Zab:

11:25 < zab> markflar: load average is just a useless total of the number in 
             uninterruptible

Signed-off-by: manish



Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-04-29 18:37:52 UTC (rev 2202)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-04-29 22:42:10 UTC (rev 2203)
@@ -44,6 +44,7 @@
 
 #include <linux/linkage.h>
 #include <linux/time.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/fcntl.h>
 #include <linux/net.h>
@@ -724,8 +725,10 @@
 
 	while (!kthread_should_stop()) {
 		hb_do_disk_heartbeat(reg);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(msecs_to_jiffies(HB_THREAD_MS));
+
+		/* the kthread api has blocked signals for us so no
+		 * need to record the return value. */
+		msleep_interruptible(HB_THREAD_MS);
 	}
 
 	for(i = 0; i < reg->hr_blocks; i++)

Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c	2005-04-29 18:37:52 UTC (rev 2202)
+++ trunk/fs/ocfs2/journal.c	2005-04-29 22:42:10 UTC (rev 2203)
@@ -1572,16 +1572,10 @@
 	while (!(kthread_should_stop() && 
 		 atomic_read(&journal->j_num_trans) == 0)) {
 
-		status = wait_event_timeout(osb->checkpoint_event,
-					    atomic_read(&journal->j_num_trans)
-					    || kthread_should_stop(),
-					    OCFS_CHECKPOINT_INTERVAL);
-		if (status == 0)
-			mlog(0, "timed out\n");
-		else if (status == -ERESTARTSYS)
-			mlog(0, "signal pending\n");
-		else
-			mlog(0, "woken\n");
+		wait_event_interruptible_timeout(osb->checkpoint_event,
+						 atomic_read(&journal->j_num_trans)
+						 || kthread_should_stop(),
+						 OCFS_CHECKPOINT_INTERVAL);
 
 		status = ocfs_commit_cache(osb);
 		if (status < 0)
@@ -1592,7 +1586,6 @@
 			     "pending on shutdown\n",
 			     atomic_read(&journal->j_num_trans));
 		}
-
 	}
 
 	return 0;

Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c	2005-04-29 18:37:52 UTC (rev 2202)
+++ trunk/fs/ocfs2/vote.c	2005-04-29 22:42:10 UTC (rev 2203)
@@ -402,9 +402,9 @@
 	while (!(kthread_should_stop() &&
 		 ocfs2_vote_thread_lists_empty(osb))) {
 
-		wait_event(osb->vote_event,
-			   ocfs2_vote_thread_should_wake(osb) ||
-			   kthread_should_stop());
+		wait_event_interruptible(osb->vote_event,
+					 ocfs2_vote_thread_should_wake(osb) ||
+					 kthread_should_stop());
 
 		mlog(0, "vote_thread: awoken\n");
 



More information about the Ocfs2-commits mailing list