This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
RHEL5 - dm-log-clustered: Revert previous optimization
- From: Jonathan Brassow <jbrassow at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Mon, 8 Sep 2008 15:58:22 +0000 (UTC)
- Subject: RHEL5 - dm-log-clustered: Revert previous optimization
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cb98d9c47d019b99547bc21cd94f7fee6b883d4b
Commit: cb98d9c47d019b99547bc21cd94f7fee6b883d4b
Parent: a4f4f109ae329a96632f776d1ce166241f5aa1e1
Author: Jonathan Brassow <jbrassow@redhat.com>
AuthorDate: Mon Sep 8 10:56:57 2008 -0500
Committer: Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Mon Sep 8 10:58:03 2008 -0500
dm-log-clustered: Revert previous optimization
I am getting kernel panics with backtraces that don't make
any sense when the optimization is in place... could indicate
stack overflow or simply a memory boundary issue. Reverting
for now.
---
cmirror-kernel/src/dm-clog.c | 72 +++--------------------------------------
1 files changed, 6 insertions(+), 66 deletions(-)
diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c
index fef062d..62ad414 100644
--- a/cmirror-kernel/src/dm-clog.c
+++ b/cmirror-kernel/src/dm-clog.c
@@ -401,12 +401,10 @@ static int cluster_in_sync(struct dirty_log *log, region_t region, int can_block
*
* Returns: 0 on success, < 0 on failure
*/
-#define GROUP_SIZE 50
static int cluster_flush(struct dirty_log *log)
{
- int size, marks, clears, m, c, r = 0;
+ int r = 0;
int flags;
- region_t *m_ptr, *c_ptr;
struct log_c *lc = (struct log_c *)log->context;
LIST_HEAD(flush_list);
struct flush_entry *fe, *tmp_fe;
@@ -419,74 +417,21 @@ static int cluster_flush(struct dirty_log *log)
return 0;
/*
- * Count up requests, group request types,
+ * FIXME: Count up requests, group request types,
* allocate memory to stick all requests in and
* send to server in one go. Failing the allocation,
* do it one by one.
*/
- clears = marks = 0;
-
- list_for_each_entry(fe, &flush_list, list) {
- if (fe->type == DM_CLOG_MARK_REGION)
- marks++;
- else
- clears++;
- }
- m = marks;
- c = clears;
- c_ptr = m_ptr = NULL;
-
- if (marks > 1)
- m_ptr = kmalloc(sizeof(*m_ptr)*marks, GFP_KERNEL);
-
- if (clears > 1)
- c_ptr = kmalloc(sizeof(*c_ptr)*clears, GFP_KERNEL);
-
list_for_each_entry(fe, &flush_list, list) {
- if ((fe->type == DM_CLOG_MARK_REGION) && (m_ptr))
- m_ptr[--m] = fe->region;
- else if ((fe->type == DM_CLOG_CLEAR_REGION) && (c_ptr))
- c_ptr[--c] = fe->region;
- else
- r = cluster_do_request(lc, lc->uuid, fe->type,
- (char *)&fe->region,
- sizeof(fe->region),
- NULL, NULL);
+ r = cluster_do_request(lc, lc->uuid, fe->type,
+ (char *)&fe->region,
+ sizeof(fe->region),
+ NULL, NULL);
if (r)
goto fail;
}
- if (m_ptr) {
- /* If there is more than GROUP_SIZE, send in groups */
- for (m = 0; m < marks; m += GROUP_SIZE) {
- size = ((marks - m) > GROUP_SIZE) ? GROUP_SIZE : (marks - m);
- size *= sizeof(*m_ptr);
-
- r = cluster_do_request(lc, lc->uuid,
- DM_CLOG_MARK_REGION,
- (char *)(m_ptr + m), size,
- NULL, NULL);
- if (r)
- goto fail;
- }
- }
-
- if (c_ptr) {
- /* If there is more than GROUP_SIZE, send in groups */
- for (c = 0; c < clears; c += GROUP_SIZE) {
- size = ((clears - c) > GROUP_SIZE) ? GROUP_SIZE : (clears - c);
- size *= sizeof(*c_ptr);
-
- r = cluster_do_request(lc, lc->uuid,
- DM_CLOG_CLEAR_REGION,
- (char *)(c_ptr + c), size,
- NULL, NULL);
- if (r)
- goto fail;
- }
- }
-
r = cluster_do_request(lc, lc->uuid, DM_CLOG_FLUSH,
NULL, 0, NULL, NULL);
@@ -496,11 +441,6 @@ fail:
* Calling code will receive an error and will know that
* the log facility has failed.
*/
- if (m_ptr)
- kfree(m_ptr);
- if (c_ptr)
- kfree(c_ptr);
-
list_for_each_entry_safe(fe, tmp_fe, &flush_list, list) {
list_del(&fe->list);
mempool_free(fe, flush_entry_pool);