CVSROOT:        /cvs/cluster
Module name:    cluster
Branch:         RHEL5
Changes by:     [EMAIL PROTECTED]       2008-01-25 16:24:47

Modified files:
        cmirror/src    : link_mon.c local.c queues.c 

Log message:
        - reduce the number of cluster requests.
        
        - debugging code that counts requests will be removed later

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/link_mon.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/src/local.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.9&r2=1.1.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/queues.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5

--- cluster/cmirror/src/Attic/link_mon.c        2008/01/14 22:52:17     1.1.2.3
+++ cluster/cmirror/src/Attic/link_mon.c        2008/01/25 16:24:47     1.1.2.4
@@ -110,10 +110,8 @@
        }
 
        r = poll(pfds, used_pfds, -1);
-       if (r <= 0) {
-               LOG_ERROR("Error from poll: %d", r);
+       if (r <= 0)
                return r;
-       }
 
        r = 0;
        /* FIXME: handle POLLHUP */
--- cluster/cmirror/src/Attic/local.c   2008/01/23 21:21:06     1.1.2.9
+++ cluster/cmirror/src/Attic/local.c   2008/01/25 16:24:47     1.1.2.10
@@ -17,6 +17,7 @@
 
 static int cn_fd;  /* Connector (netlink) socket fd */
 static int request_array[20];  /* for request counting (debugging) */
+static int cluster_array[20];  /* for request counting (debugging) */
 
 static int kernel_recv_helper(void *data, int in_size)
 {
@@ -155,9 +156,6 @@
 
        request_array[tfr->request_type]++;
        request_count++;
-       if (!(request_count % 10000))
-               for (i = 0; i < 20; i++)
-                       LOG_PRINT("  %s: %d", RQ_TYPE(i), request_array[i]);
 
        LOG_DBG("Request from kernel recieved [%s/%s/%llu]",
                RQ_TYPE(tfr->request_type), SHORT_UUID(tfr->uuid),
@@ -165,6 +163,7 @@
        switch (tfr->request_type) {
        case DM_CLOG_CTR:
        case DM_CLOG_DTR:
+       case DM_CLOG_IN_SYNC:
        case DM_CLOG_STATUS_INFO:
        case DM_CLOG_STATUS_TABLE:
        case DM_CLOG_PRESUSPEND:
@@ -209,6 +208,7 @@
                }
                /* ELSE, fall through to default */
        default:
+               cluster_array[tfr->request_type]++;
                /* Add before send_to_cluster, so cluster code can find it */
                queue_add_tail(tfr, cluster_queue);
                r = cluster_send(tfr);
@@ -223,6 +223,14 @@
                tfr->error = r;
        }
 
+       if (!(request_count % 10000)) {
+               LOG_PRINT("Total requests (%d):", request_count);
+               for (i = 0; i < 20; i++)
+                       LOG_PRINT("  %s: %d", RQ_TYPE(i), request_array[i]);
+               LOG_PRINT("Cluster-bound requests:");
+               for (i = 0; i < 20; i++)
+                       LOG_PRINT("  %s: %d", RQ_TYPE(i), cluster_array[i]);
+       }
        EXIT();
        return r;
 }
@@ -296,6 +304,7 @@
        ENTER();
 
        memset(request_array, 0, sizeof(int)*20);
+       memset(cluster_array, 0, sizeof(int)*20);
 
        cn_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
        if (cn_fd < 0) {
--- cluster/cmirror/src/Attic/queues.c  2008/01/23 21:21:06     1.1.2.4
+++ cluster/cmirror/src/Attic/queues.c  2008/01/25 16:24:47     1.1.2.5
@@ -25,7 +25,7 @@
        if (!q)
                return;
 
-       if (q->count)
+       if (q->count && (q != free_queue))
                LOG_ERROR("WARNING: There are still items in %s\n",
                          WHICH_QUEUE(q));
 

Reply via email to