All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs-kernel/src/dlm lock_dlm.h main.c p ...
Date: 23 Mar 2007 18:05:18 -0000	[thread overview]
Message-ID: <20070323180518.29655.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	STABLE
Changes by:	rpeterso at sourceware.org	2007-03-23 18:05:15

Modified files:
	gfs-kernel/src/dlm: lock_dlm.h main.c plock.c 

Log message:
	Resolves: Bugzilla Bug 233167: [CitiStreet] Kernel Panic when spawn
	listener processes on GFS.  Patch written by Josef Bacik (Whiter).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.18.2.3.6.4&r2=1.18.2.3.6.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/main.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.7&r2=1.7.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/plock.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.12.8.3&r2=1.12.8.4

--- cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h	2007/02/07 15:25:05	1.18.2.3.6.4
+++ cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h	2007/03/23 18:05:14	1.18.2.3.6.5
@@ -46,6 +46,7 @@
 #define LOCK_DLM_STRNAME_BYTES	(24)
 
 #define LOCK_DLM_MAX_NODES	(128)
+#define LOCK_DLM_MAX_PLOCK	(1024)
 
 #define DROP_LOCKS_COUNT	(200000)
 #define DROP_LOCKS_PERIOD	(60)
--- cluster/gfs-kernel/src/dlm/Attic/main.c	2004/11/02 04:50:49	1.7
+++ cluster/gfs-kernel/src/dlm/Attic/main.c	2007/03/23 18:05:14	1.7.8.1
@@ -27,6 +27,7 @@
 int				lock_dlm_max_nodes;
 int				lock_dlm_drop_count;
 int				lock_dlm_drop_period;
+int				lock_dlm_max_plock_get;
 
 static char *                   debug_buf;
 static unsigned int             debug_size;
@@ -153,6 +154,11 @@
 	return sprintf(b, "%d\n", lock_dlm_max_nodes);
 }
 
+static int max_plock_info(char *b, char **start, off_t offset, int length)
+{
+	return sprintf(b, "%d\n", lock_dlm_max_plock_get);
+}
+
 static int drop_count_info(char *b, char **start, off_t offset, int length)
 {
 	return sprintf(b, "%d\n", lock_dlm_drop_count);
@@ -188,6 +194,16 @@
 	return rv;
 }
 
+static int max_plock_write(struct file *file, const char *buffer,
+			   unsigned long count, void *data)
+{
+	int rv = copy_string(buffer, count);
+	if (rv < 0)
+		return rv;
+	lock_dlm_max_plock_get = (int) simple_strtol(proc_str, NULL, 0);
+	return rv;
+}
+
 static int drop_count_write(struct file *file, const char *buffer,
 			    unsigned long count, void *data)
 {
@@ -210,7 +226,8 @@
 
 static void create_proc_entries(void)
 {
-	struct proc_dir_entry *p, *debug, *drop_count, *drop_period, *max_nodes;
+	struct proc_dir_entry *p, *debug, *drop_count, *drop_period,
+		*max_nodes, *plock_get;
 
 	debug = drop_count = drop_period = max_nodes = NULL;
 
@@ -227,6 +244,14 @@
 	p->write_proc = max_nodes_write;
 	max_nodes = p;
 
+	p = create_proc_entry("max_plock_get", 0666, proc_dir);
+	if (!p)
+		goto out;
+	p->owner = THIS_MODULE;
+	p->get_info = max_plock_info;
+	p->write_proc = max_plock_write;
+	plock_get = p;
+
 	p = create_proc_entry("debug", 0444, proc_dir);
 	if (!p)
 		goto out;
@@ -259,6 +284,8 @@
 		remove_proc_entry("drop_count", proc_dir);
 	if (debug)
 		remove_proc_entry("debug", proc_dir);
+	if (plock_get)
+		remove_proc_entry("max_plock_get", proc_dir);
 	if (max_nodes)
 		remove_proc_entry("max_nodes", proc_dir);
 
@@ -270,6 +297,7 @@
 {
 	if (proc_dir) {
 		remove_proc_entry("max_nodes", proc_dir);
+		remove_proc_entry("max_plock_get", proc_dir);
 		remove_proc_entry("debug", proc_dir);
 		remove_proc_entry("drop_period", proc_dir);
 		remove_proc_entry("drop_count", proc_dir);
@@ -298,6 +326,7 @@
 	lock_dlm_max_nodes = LOCK_DLM_MAX_NODES;
 	lock_dlm_drop_count = DROP_LOCKS_COUNT;
 	lock_dlm_drop_period = DROP_LOCKS_PERIOD;
+	lock_dlm_max_plock_get = LOCK_DLM_MAX_PLOCK;
 
 #ifdef CONFIG_PROC_FS
 	create_proc_entries();
--- cluster/gfs-kernel/src/dlm/Attic/plock.c	2006/09/15 17:43:41	1.12.8.3
+++ cluster/gfs-kernel/src/dlm/Attic/plock.c	2007/03/23 18:05:14	1.12.8.4
@@ -30,6 +30,8 @@
 
 #define HEAD      1
 
+extern int lock_dlm_max_plock_get;
+
 static int local_conflict(dlm_t *dlm, struct dlm_resource *r,
 			  struct lm_lockname *name, unsigned long owner,
 			  uint64_t start, uint64_t end, int ex);
@@ -1055,7 +1057,7 @@
 	dlm_lock_t *lp;
 	struct dlm_queryinfo qinfo;
 	struct dlm_lockinfo *lki;
-	int query = 0, s, error;
+	int query = 0, s = 0, error;
 
 	/* acquire a null lock on which to base the query */
 
@@ -1076,14 +1078,13 @@
 	query = DLM_LOCK_THIS | DLM_QUERY_QUEUE_GRANTED |
 		DLM_QUERY_LOCKS_HIGHER;
 
-	for (s = 16; s < dlm->max_nodes + 1; s += 16) {
-
-		lki = kmalloc(s * sizeof(struct dlm_lockinfo), GFP_KERNEL);
+	do {
+		s += 16;
+		lki = kzalloc(s * sizeof(struct dlm_lockinfo), GFP_KERNEL);
 		if (!lki) {
 			error = -ENOMEM;
 			goto out;
 		}
-		memset(lki, 0, s * sizeof(struct dlm_lockinfo));
 		memset(&qinfo, 0, sizeof(qinfo));
 		qinfo.gqi_locksize = s;
 		qinfo.gqi_lockinfo = lki;
@@ -1103,11 +1104,14 @@
 		kfree(lki);
 		if (error != -E2BIG)
 			goto out;
-	}
+	} while (error == -E2BIG && s < lock_dlm_max_plock_get);
 
 	/* check query results for blocking locks */
 
-	error = 0;
+	if (error) {
+		error = -EAGAIN;
+		goto out;
+	}
 
 	for (s = 0; s < qinfo.gqi_lockcount; s++) {
 



             reply	other threads:[~2007-03-23 18:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23 18:05 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-22 21:23 [Cluster-devel] cluster/gfs-kernel/src/dlm lock_dlm.h main.c p rpeterso

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=20070323180518.29655.qmail@sourceware.org \
    --to=rpeterso@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.