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;
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);
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);
}
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/mman.h>
#include "common.h"
#include "log.h"
// --------------------------------------------------------------------
+#ifdef MADV_MERGEABLE
enable_ksm = config_get_boolean("global", "memory deduplication (ksm)", enable_ksm);
+#else
+#warning "Kernel memory deduplication (KSM) is not available"
+#endif
// --------------------------------------------------------------------
\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