Hello,

I tried to compile Corosync with ./configure --enable-small-memory-footprint, but it appeared it still used many megabytes of shared memory. It was due to Corosync's logsys shared memory and to my connection to CLM.

For OpenAIS, I've added an option --enable-small-memory-footprint to its ./configure (copied from the one of Corosync).

By the way, I assume this option makes processes spend more time on synchronization operations, but is there any other known drawback to it ? (possible instability ?)
diff --git corosync/exec/main.c corosync/exec/main.c
index 9d7c21b..1032c76 100644
--- corosync/exec/main.c
+++ corosync/exec/main.c
@@ -87,6 +87,12 @@
 #include "schedwrk.h"
 #include "evil.h"
 
+#ifdef HAVE_SMALL_MEMORY_FOOTPRINT
+#define IPC_LOGSYS_SIZE                        1024*64
+#else
+#define IPC_LOGSYS_SIZE                        8192*128
+#endif
+
 LOGSYS_DECLARE_SYSTEM ("corosync",
        LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_THREADED | LOGSYS_MODE_FORK,
        0,
@@ -95,7 +101,7 @@ LOGSYS_DECLARE_SYSTEM ("corosync",
        LOG_DAEMON,
        LOG_INFO,
        NULL,
-       1000000);
+       IPC_LOGSYS_SIZE);
 
 LOGSYS_DECLARE_SUBSYS ("MAIN");
 
diff --git corosync/lib/util.h corosync/lib/util.h
index c228b42..5a657a9 100644
--- corosync/lib/util.h
+++ corosync/lib/util.h
@@ -38,6 +38,8 @@
 
 #include <errno.h>
 
+#include <config.h>
+
 static inline cs_error_t hdb_error_to_cs (int res)             \
 {                                                              \
        if (res == 0) {                                         \
diff --git openais/configure.ac openais/configure.ac
index d5f7812..6987f37 100644
--- openais/configure.ac
+++ openais/configure.ac
@@ -173,6 +173,10 @@ AC_ARG_ENABLE([coverage],
        [  --enable-coverage       : coverage analysis of the codebase. ],
        [ default="no" ])
 
+AC_ARG_ENABLE([small-memory-footprint],
+       [  --enable-small-memory-footprint : Use small message queues and small 
messages sizes. ],
+       [ default="no" ])
+
 AC_ARG_WITH([initddir],
        [  --with-initddir=DIR     : path to init script directory. ],
        [ INITDDIR="$withval" ],
@@ -303,6 +307,11 @@ else
        COVERAGE_LDFLAGS=""
 fi
 
+if test "x${enable_small_memory_footprint}" = xyes ; then
+       AC_DEFINE_UNQUOTED([HAVE_SMALL_MEMORY_FOOTPRINT], 1, [have 
small_memory_footprint])
+       PACKAGE_FEATURES="$PACKAGE_FEATURES small-memory-footprint"
+fi
+
 if test "x${enable_fatal_warnings}" = xyes && \
                cc_supports_flag -Werror ; then
        AC_MSG_NOTICE([Enabling Fatal Warnings (-Werror)])
diff --git openais/lib/util.h openais/lib/util.h
index 816062e..9a59b0b 100644
--- openais/lib/util.h
+++ openais/lib/util.h
@@ -41,6 +41,7 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 
+#include <config.h>
 
 struct saVersionDatabase {
        int versionCount;
@@ -54,9 +55,15 @@ saVersionVerify (
 
 SaTimeT clustTimeNow(void);
 
+#ifdef HAVE_SMALL_MEMORY_FOOTPRINT
+#define IPC_REQUEST_SIZE        1024*64
+#define IPC_RESPONSE_SIZE       1024*64
+#define IPC_DISPATCH_SIZE       1024*64
+#else
 #define IPC_REQUEST_SIZE       8192*128
 #define IPC_RESPONSE_SIZE      8192*128
 #define IPC_DISPATCH_SIZE      8192*128
+#endif
 
 static inline SaAisErrorT hdb_error_to_sa (int res)            \
 {                                                              \
@@ -73,5 +80,4 @@ static inline SaAisErrorT hdb_error_to_sa (int res)           
\
        }                                                       \
 }
 
-
 #endif /* AIS_UTIL_H_DEFINED */

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to