public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - dlm_controld: periodically drop plock resources
@ 2009-09-03 15:31 David Teigland
0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-09-03 15:31 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2af5c6aeef466c36ddd7a7bc4e528b9a2f857ed5
Commit: 2af5c6aeef466c36ddd7a7bc4e528b9a2f857ed5
Parent: 050a85e5cffd967f6ebd03cb302637faf9bbceba
Author: David Teigland <teigland@redhat.com>
AuthorDate: Tue Aug 25 10:35:36 2009 -0500
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Thu Sep 3 10:24:21 2009 -0500
dlm_controld: periodically drop plock resources
instead of only dropping following a plock operation
Signed-off-by: David Teigland <teigland@redhat.com>
---
group/dlm_controld/dlm_daemon.h | 2 ++
group/dlm_controld/main.c | 8 ++++++++
group/dlm_controld/plock.c | 37 +++++++++++++++++++++++++++++--------
3 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index 4a7e94b..65723d1 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -73,6 +73,7 @@ extern int poll_fencing;
extern int poll_quorum;
extern int poll_fs;
extern int poll_ignore_plock;
+extern int poll_drop_plock;
extern int plock_fd;
extern int plock_ci;
extern struct list_head lockspaces;
@@ -296,6 +297,7 @@ void process_netlink(int ci);
int setup_plocks(void);
void close_plocks(void);
void process_plocks(int ci);
+void drop_resources_all(void);
int limit_plocks(void);
void receive_plock(struct lockspace *ls, struct dlm_header *hd, int len);
void receive_own(struct lockspace *ls, struct dlm_header *hd, int len);
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index 93b40f8..75ee55d 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -1011,6 +1011,13 @@ static void loop(void)
}
poll_timeout = 1000;
}
+
+ if (poll_drop_plock) {
+ drop_resources_all();
+ if (poll_drop_plock)
+ poll_timeout = 1000;
+ }
+
query_unlock();
}
out:
@@ -1310,6 +1317,7 @@ int poll_fencing;
int poll_quorum;
int poll_fs;
int poll_ignore_plock;
+int poll_drop_plock;
int plock_fd;
int plock_ci;
struct list_head lockspaces;
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 3d4431e..54f91ef 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1351,8 +1351,20 @@ static int drop_resources(struct lockspace *ls)
struct timeval now;
int count = 0;
+ if (!cfgd_plock_ownership)
+ return 0;
+
+ if (list_empty(&ls->plock_resources))
+ return 0;
+
gettimeofday(&now, NULL);
+ if (time_diff_ms(&ls->drop_resources_last, &now) <
+ cfgd_drop_resources_time)
+ return 1;
+
+ ls->drop_resources_last = now;
+
/* try to drop the oldest, unused resources */
list_for_each_entry_reverse(r, &ls->plock_resources, list) {
@@ -1376,7 +1388,21 @@ static int drop_resources(struct lockspace *ls)
}
}
- return 0;
+ return 1;
+}
+
+void drop_resources_all(void)
+{
+ struct lockspace *ls;
+ int rv = 0;
+
+ poll_drop_plock = 0;
+
+ list_for_each_entry(ls, &lockspaces, list) {
+ rv = drop_resources(ls);
+ if (rv)
+ poll_drop_plock = 1;
+ }
}
int limit_plocks(void)
@@ -1495,13 +1521,8 @@ void process_plocks(int ci)
save_pending_plock(ls, r, &info);
}
- if (cfgd_plock_ownership &&
- time_diff_ms(&ls->drop_resources_last, &now) >=
- cfgd_drop_resources_time) {
- ls->drop_resources_last = now;
- drop_resources(ls);
- }
-
+ if (cfgd_plock_ownership && !list_empty(&ls->plock_resources))
+ poll_drop_plock = 1;
return;
fail:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-03 15:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-03 15:31 cluster: STABLE3 - dlm_controld: periodically drop plock resources David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).