All of lore.kernel.org
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/gfs_controld cpg.c lock_dlm.h main.c
Date: 8 Sep 2006 22:44:34 -0000	[thread overview]
Message-ID: <20060908224434.25885.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-09-08 22:44:33

Modified files:
	group/gfs_controld: cpg.c lock_dlm.h main.c 

Log message:
	- minor change to the delay we add between each cpg_mcast retry
	- set scheduler to RR priority 2 for gfs_controld

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/main.c.diff?cvsroot=cluster&r1=1.13&r2=1.14

--- cluster/group/gfs_controld/cpg.c	2006/08/09 19:35:26	1.6
+++ cluster/group/gfs_controld/cpg.c	2006/09/08 22:44:33	1.7
@@ -183,7 +183,7 @@
 	return fd;
 }
 
-static int _send_message(cpg_handle_t h, void *buf, int len)
+static int _send_message(cpg_handle_t h, void *buf, int len, int type)
 {
 	struct iovec iov;
 	cpg_error_t error;
@@ -195,23 +195,30 @@
  retry:
 	error = cpg_mcast_joined(h, CPG_TYPE_AGREED, &iov, 1);
 	if (error == CPG_ERR_TRY_AGAIN) {
-		log_debug("cpg_mcast_joined error %d", error);
 		retries++;
-		if (retries > 3)
-			sleep(1);
+		usleep(1000);
+		if (!(retries % 100))
+			log_error("cpg_mcast_joined retry %d %s",
+				   retries, msg_name(type));
 		goto retry;
 	}
 	if (error != CPG_OK) {
-		log_error("cpg_mcast_joined error %d handle %llx", error, h);
+		log_error("cpg_mcast_joined error %d handle %llx %s",
+			  error, h, msg_name(type));
 		return -1;
 	}
 
+	if (retries)
+		log_debug("cpg_mcast_joined retried %d %s",
+			  retries, msg_name(type));
+
 	return 0;
 }
 
 int send_group_message(struct mountgroup *mg, int len, char *buf)
 {
 	struct gdlm_header *hd = (struct gdlm_header *) buf;
+	int type = hd->type;
 
 	hd->version[0]	= cpu_to_le16(GDLM_VER_MAJOR);
 	hd->version[1]	= cpu_to_le16(GDLM_VER_MINOR);
@@ -221,6 +228,6 @@
 	hd->to_nodeid	= cpu_to_le32(hd->to_nodeid);
 	memcpy(hd->name, mg->name, strlen(mg->name));
 	
-	return _send_message(daemon_handle, buf, len);
+	return _send_message(daemon_handle, buf, len, type);
 }
 
--- cluster/group/gfs_controld/lock_dlm.h	2006/08/31 19:13:02	1.17
+++ cluster/group/gfs_controld/lock_dlm.h	2006/09/08 22:44:33	1.18
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <time.h>
 #include <syslog.h>
+#include <sched.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <sys/poll.h>
--- cluster/group/gfs_controld/main.c	2006/08/31 19:13:02	1.13
+++ cluster/group/gfs_controld/main.c	2006/09/08 22:44:33	1.14
@@ -594,6 +594,24 @@
 	}
 }
 
+void set_scheduler(void)
+{
+	struct sched_param sched_param;
+	int rv;
+
+	rv = sched_get_priority_max(SCHED_RR);
+	if (rv != -1) {
+		sched_param.sched_priority = 2;
+		rv = sched_setscheduler(0, SCHED_RR, &sched_param);
+		if (rv == -1)
+			log_error("could not set SCHED_RR priority %d err %d",
+				   sched_param.sched_priority, errno);
+	} else {
+		log_error("could not get maximum scheduler priority err %d",
+			  errno);
+	}
+}
+
 int main(int argc, char **argv)
 {
 	prog_name = argv[0];
@@ -605,6 +623,8 @@
 	if (!daemon_debug_opt)
 		daemonize();
 
+	set_scheduler();
+
 	return loop();
 }
 



                 reply	other threads:[~2006-09-08 22:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060908224434.25885.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    /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.