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 pl ...
Date: 20 Nov 2006 21:10:29 -0000	[thread overview]
Message-ID: <20061120211029.28559.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	teigland at sourceware.org	2006-11-20 21:10:28

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

Log message:
	fix a couple of problems if openais enables flow control:
	- the poll loop spins due to plocks being ready to process but being
	ignored due to the flow control; we need to remove the plock fd from
	the poll set when flow control is enabled (just like we do when the
	plock rate limiter is active)
	- we were not updating the flow control state from openais when
	flow control was enabled unless we received a cpg message; we need
	to update it periodically while blocked since we may not receive
	cpg messages from other nodes causing us to update the state

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9&r2=1.9.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21&r2=1.21.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/plock.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.25.2.2&r2=1.25.2.3

--- cluster/group/gfs_controld/cpg.c	2006/10/13 20:00:02	1.9
+++ cluster/group/gfs_controld/cpg.c	2006/11/20 21:10:28	1.9.2.1
@@ -131,11 +131,31 @@
 	.cpg_confchg_fn = confchg_cb,
 };
 
-int process_cpg(void)
+void update_flow_control_status(void)
 {
 	cpg_flow_control_state_t flow_control_state;
 	cpg_error_t error;
 	
+	error = cpg_flow_control_state_get(daemon_handle, &flow_control_state);
+	if (error != CPG_OK) {
+		log_error("cpg_flow_control_state_get %d", error);
+		return;
+	}
+
+	if (flow_control_state == CPG_FLOW_CONTROL_ENABLED) {
+		message_flow_control_on = 1;
+		log_debug("flow control on");
+	} else {
+		if (message_flow_control_on)
+			log_debug("flow control off");
+		message_flow_control_on = 0;
+	}
+}
+
+int process_cpg(void)
+{
+	cpg_error_t error;
+
 	got_msg = 0;
 	saved_len = 0;
 	saved_nodeid = 0;
@@ -150,20 +170,7 @@
 	if (got_msg)
 		do_deliver(saved_nodeid, saved_data, saved_len);
 
-	error = cpg_flow_control_state_get(daemon_handle, &flow_control_state);
-	if (error != CPG_OK) {
-		log_error("cpg_flow_control_state_get %d", error);
-		return -1;
-	}
-
-	if (flow_control_state == CPG_FLOW_CONTROL_ENABLED) {
-		message_flow_control_on = 1;
-		log_debug("flow control on");
-	} else {
-		if (message_flow_control_on)
-			log_debug("flow control off");
-		message_flow_control_on = 0;
-	}
+	update_flow_control_status();
 
 	return 0;
 }
--- cluster/group/gfs_controld/lock_dlm.h	2006/10/23 15:44:33	1.21
+++ cluster/group/gfs_controld/lock_dlm.h	2006/11/20 21:10:28	1.21.2.1
@@ -280,6 +280,7 @@
 int client_send(int ci, char *buf, int len);
 
 int send_group_message(struct mountgroup *mg, int len, char *buf);
+void update_flow_control_status(void);
 
 void store_plocks(struct mountgroup *mg, int nodeid);
 void retrieve_plocks(struct mountgroup *mg);
--- cluster/group/gfs_controld/plock.c	2006/11/20 18:12:54	1.25.2.2
+++ cluster/group/gfs_controld/plock.c	2006/11/20 21:10:28	1.25.2.3
@@ -336,8 +336,12 @@
 	int len, rv;
 
 	/* Don't send more messages while the cpg message queue is backed up */
-	if (message_flow_control_on)
-		return 0;
+
+	if (message_flow_control_on) {
+		update_flow_control_status();
+		if (message_flow_control_on)
+			return -EBUSY;
+	}
 
 	/* Every N ops we check how long it's taken to do those N ops.
 	   If it's less than 1000 ms, we don't take any more. */



             reply	other threads:[~2006-11-20 21:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 21:10 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-20 21:10 [Cluster-devel] cluster/group/gfs_controld cpg.c lock_dlm.h pl teigland
2006-11-20 21:07 teigland

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=20061120211029.28559.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.