FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-14-2008, 09:46 PM
 
Default cluster/cmirror-kernel/src dm-clog-tfr.c dm-clog.c

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow@sourceware.org 2008-01-14 22:46:58

Modified files:
cmirror-kernel/src: dm-clog-tfr.c dm-clog.c

Log message:
- clear memory before it is written to. (was causing mirror CTR to fail).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog-tfr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1= 1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1 =1.2.2.4&r2=1.2.2.5

--- cluster/cmirror-kernel/src/dm-clog-tfr.c 2007/11/08 22:16:53 1.1.2.3
+++ cluster/cmirror-kernel/src/dm-clog-tfr.c 2008/01/14 22:46:58 1.1.2.4
@@ -12,6 +12,8 @@
#include "dm.h"
#include "dm-clog-tfr.h"

+#include <asm/div64.h> /* Unnecessary */
+
static uint64_t seq = 0;

/*
@@ -28,6 +30,7 @@
struct list_head list;
struct completion complete;

+ unsigned long long start_time;
uint64_t seq;

int error;
@@ -120,6 +123,7 @@
*
* Returns: 0 on success, -EXXX on failure
*/
+static uint32_t foo[15]; /* FIXME: Pull this... Track number of sec */
int dm_clog_consult_server(const char *uuid, int request_type,
char *data, int data_size,
char *rdata, int *rdata_size)
@@ -133,8 +137,9 @@
if (data_size > (DM_CLOG_PREALLOCED_SIZE - overhead_size)) {
DMINFO("Size of tfr exceeds preallocated size");
/* FIXME: is kmalloc sufficient if we need this much space? */
- tfr = kmalloc(data_size + sizeof(*tfr), GFP_NOIO);
- }
+ tfr = kzalloc(data_size + sizeof(*tfr), GFP_NOIO);
+ } else
+ memset(tfr, 0, DM_CLOG_PREALLOCED_SIZE - overhead_size);

if (!tfr)
return -ENOMEM;
@@ -148,7 +153,6 @@
*/
mutex_lock(&_lock);

- memset(tfr, 0, data_size + sizeof(*tfr));
memcpy(tfr->uuid, uuid, DM_UUID_LEN);
tfr->seq = seq++;
tfr->request_type = request_type;
@@ -164,6 +168,7 @@
spin_lock(&recieving_list_lock);
list_add(&(pkg.list), &recieving_list);
spin_unlock(&recieving_list_lock);
+ pkg.start_time = jiffies;

r = dm_clog_sendto_server(tfr);

@@ -184,7 +189,20 @@
list_del_init(&(pkg.list));
spin_unlock(&recieving_list_lock);

+ foo[10]++;
+ DMWARN("[%u][%u][%u][%u][%u][%u] [%u]",
+ foo[0], foo[1], foo[2], foo[3], foo[4], foo[5],
+ foo[10]);
+
goto resend;
+ } else {
+ /* FIXME: Pull time checking code - it's just for profiling */
+ pkg.start_time = (jiffies - pkg.start_time);
+ do_div(pkg.start_time, HZ);
+ if ((pkg.start_time < 0) || (pkg.start_time >= 5))
+ DMWARN("OUT-OF-BOUNDS:: pkg.start_time == %llu", pkg.start_time);
+ else
+ foo[pkg.start_time]++;
}
r = pkg.error;
if (r)
--- cluster/cmirror-kernel/src/dm-clog.c 2007/11/03 18:37:48 1.2.2.4
+++ cluster/cmirror-kernel/src/dm-clog.c 2008/01/14 22:46:58 1.2.2.5
@@ -654,7 +654,7 @@
return r;
}

- DMINFO("dm-log-clustered (built %s %s) installed", __DATE__, __TIME__);
+ DMINFO("(built %s %s) installed", __DATE__, __TIME__);
return 0;
}

@@ -664,7 +664,7 @@
dm_unregister_dirty_log_type(&_clustered_core_type );
dm_clog_tfr_exit();
mempool_destroy(flush_entry_pool);
- DMINFO("dm-log-clustered (built %s %s) removed", __DATE__, __TIME__);
+ DMINFO("(built %s %s) removed", __DATE__, __TIME__);
return;
}
 
Old 02-08-2008, 01:21 PM
 
Default cluster/cmirror-kernel/src dm-clog-tfr.c dm-clog.c

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow@sourceware.org 2008-02-08 14:21:05

Modified files:
cmirror-kernel/src: dm-clog-tfr.c dm-clog.c

Log message:
- table an event so userspace can respond when a log device failure
occurs
- other clean-ups

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog-tfr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1= 1.1.2.4&r2=1.1.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1 =1.2.2.8&r2=1.2.2.9

--- cluster/cmirror-kernel/src/dm-clog-tfr.c 2008/01/14 22:46:58 1.1.2.4
+++ cluster/cmirror-kernel/src/dm-clog-tfr.c 2008/02/08 14:21:04 1.1.2.5
@@ -72,6 +72,7 @@

static void cn_clog_callback(void *data)
{
+ int found = 0;
struct cn_msg *msg = (struct cn_msg *)data;
struct clog_tfr *tfr = (struct clog_tfr *)(msg + 1);
struct recieving_pkg *pkg;
@@ -100,13 +101,16 @@
memcpy(pkg->data, tfr->data, tfr->data_size);
*(pkg->data_size) = tfr->data_size;
}
-
+ found = 1;
complete(&pkg->complete);
break;
}
}

spin_unlock(&recieving_list_lock);
+ if (!found)
+ DMERR("Stray request returned: %s, %llu",
+ RQ_TYPE(tfr->request_type), tfr->seq);
}

/*
@@ -123,7 +127,6 @@
*
* Returns: 0 on success, -EXXX on failure
*/
-static uint32_t foo[15]; /* FIXME: Pull this... Track number of sec */
int dm_clog_consult_server(const char *uuid, int request_type,
char *data, int data_size,
char *rdata, int *rdata_size)
@@ -180,29 +183,22 @@
goto out;
}

- r = wait_for_completion_timeout(&(pkg.complete), 5 * HZ);
+ r = wait_for_completion_timeout(&(pkg.complete), 15 * HZ);
if (!r) {
- DMWARN("Timed out waiting for cluster log server [%s]",
- RQ_TYPE(request_type));
- DMWARN("Retrying request [%s]", RQ_TYPE(request_type));
+ DMWARN("Request timed out on %s:%llu - retrying",
+ RQ_TYPE(request_type), pkg.seq);
spin_lock(&recieving_list_lock);
list_del_init(&(pkg.list));
spin_unlock(&recieving_list_lock);

- foo[10]++;
- DMWARN("[%u][%u][%u][%u][%u][%u] [%u]",
- foo[0], foo[1], foo[2], foo[3], foo[4], foo[5],
- foo[10]);
-
goto resend;
} else {
/* FIXME: Pull time checking code - it's just for profiling */
pkg.start_time = (jiffies - pkg.start_time);
do_div(pkg.start_time, HZ);
- if ((pkg.start_time < 0) || (pkg.start_time >= 5))
- DMWARN("OUT-OF-BOUNDS:: pkg.start_time == %llu", pkg.start_time);
- else
- foo[pkg.start_time]++;
+ if (pkg.start_time > 0)
+ DMWARN("Excessive delay in request processing, %llu sec for %s",
+ pkg.start_time, RQ_TYPE(request_type));
}
r = pkg.error;
if (r)
--- cluster/cmirror-kernel/src/dm-clog.c 2008/01/25 16:23:24 1.2.2.8
+++ cluster/cmirror-kernel/src/dm-clog.c 2008/02/08 14:21:04 1.2.2.9
@@ -425,16 +425,8 @@
goto fail;
}

- do {
- r = cluster_do_request(lc, lc->uuid, DM_CLOG_FLUSH,
- NULL, 0, NULL, NULL);
- if (r != -EAGAIN)
- break;
-
- DMINFO("Flush conflicts with recovery [delaying]");
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ/4);
- } while (1);
+ r = cluster_do_request(lc, lc->uuid, DM_CLOG_FLUSH,
+ NULL, 0, NULL, NULL);

fail:
/*
@@ -447,6 +439,9 @@
mempool_free(fe, flush_entry_pool);
}

+ if (r)
+ dm_table_event(lc->ti->table);
+
return r;
}
 

Thread Tools




All times are GMT. The time now is 05:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org