]> arthur.barton.de Git - netdata.git/commitdiff
do not attempt to use KSM if it is not available
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Wed, 23 Dec 2015 18:57:46 +0000 (20:57 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Wed, 23 Dec 2015 18:57:46 +0000 (20:57 +0200)
src/common.c
src/main.c
web/dashboard.css

index 63fed585111b98e3a326cf417ccdf286aa473b73..bf713195e1b1602a34e902d0cbc70b96b4561479 100755 (executable)
@@ -122,7 +122,9 @@ void *mymmap(const char *filename, unsigned long size, int flags, int ksm)
                                if(ftruncate(fd, size))
                                        error("Cannot truncate file '%s' to size %ld. Will use the larger file.", filename, size);
 
+#ifdef MADV_MERGEABLE
                                if(flags & MAP_SHARED || !enable_ksm || !ksm) {
+#endif
                                        mem = mmap(NULL, size, PROT_READ|PROT_WRITE, flags, fd, 0);
                                        if(mem) {
                                                int advise = MADV_SEQUENTIAL|MADV_DONTFORK;
@@ -131,6 +133,7 @@ void *mymmap(const char *filename, unsigned long size, int flags, int ksm)
                                                if(madvise(mem, size, advise) != 0)
                                                        error("Cannot advise the kernel about the memory usage of file '%s'.", filename);
                                        }
+#ifdef MADV_MERGEABLE
                                }
                                else {
                                        mem = mmap(NULL, size, PROT_READ|PROT_WRITE, flags|MAP_ANONYMOUS, -1, 0);
@@ -149,6 +152,7 @@ void *mymmap(const char *filename, unsigned long size, int flags, int ksm)
                                        else
                                                error("Cannot allocate PRIVATE ANONYMOUS memory for KSM for file '%s'.", filename);
                                }
+#endif
                        }
                        else error("Cannot write to file '%s' at position %ld.", filename, size);
                }
index 1126c4386650b71aef2b363f908dd96ca908c68d..953a7e665c4e0b1379b7efaf177f23c121e4f2fd 100755 (executable)
@@ -13,6 +13,7 @@
 #include <sys/wait.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/mman.h>
 
 #include "common.h"
 #include "log.h"
@@ -289,7 +290,11 @@ int main(int argc, char **argv)
 
                // --------------------------------------------------------------------
 
+#ifdef MADV_MERGEABLE
                enable_ksm = config_get_boolean("global", "memory deduplication (ksm)", enable_ksm);
+#else
+#warning "Kernel memory deduplication (KSM) is not available"
+#endif
 
                // --------------------------------------------------------------------
 
index 0ae6134f280f25886066359189a6b9493985e170..ecb3b9aa30ec815b8b5d2c2a8352f80194e5dcc1 100755 (executable)
@@ -272,39 +272,9 @@ html {
 \r
 }\r
 \r
-/* make dygraph legend disappear on hover */\r
-.dygraph-legend {\r
-       opacity: 0.9;\r
-       -webkit-transition:opacity 0.2s ease;\r
-       -moz-transition:opacity 0.2s ease;\r
-       -o-transition:opacity 0.2s ease;\r
-       padding: 4px;\r
+.dygraph-ylabel {\r
 }\r
 \r
-.dygraph-legend:hover {\r
-       /* Red(0-255), Blue(0-255), Green(0-255), Alpha (0-1) */\r
-       background-color:rgba(100,100,100,0); \r
-       opacity:0;\r
-}\r
-\r
-/* TEST\r
-.dygraph-legend {\r
-       position: absolute;\r
-       background: rgb(0, 0, 0) transparent !important;\r
-       background-color: rgba(0,0,0,0.6) !important;\r
-       filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000) !important;\r
-       -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)" !important;\r
-       color: white !important;\r
-       font: 10px arial, san serif !important;\r
-       text-align: left !important;\r
-       white-space: nowrap !important;\r
-       padding: 5px !important;\r
-       border: 1px solid white !important;\r
-       box-sizing: content-box !important;\r
-       z-index: 10000 !important;\r
-}\r
-*/\r
-\r
 .dygraph-title {\r
        text-indent: 56px;\r
        text-align: left;\r