Commit 3a2fcd0e authored by Matthieu Dorier's avatar Matthieu Dorier

added use of madvise

parent d33334a3
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
...@@ -173,6 +174,8 @@ extern "C" int remi_fileset_migrate( ...@@ -173,6 +174,8 @@ extern "C" int remi_fileset_migrate(
cleanup(); cleanup();
return REMI_ERR_ALLOCATION; return REMI_ERR_ALLOCATION;
} }
// indicate sequential access
madvise(segment, size, MADV_SEQUENTIAL);
// close file descriptor // close file descriptor
close(fd); close(fd);
// insert the segment // insert the segment
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
...@@ -120,6 +121,7 @@ struct remi_provider : public tl::provider<remi_provider> { ...@@ -120,6 +121,7 @@ struct remi_provider : public tl::provider<remi_provider> {
req.respond(result); req.respond(result);
return; return;
} }
madvise(segment, filesizes[i], MADV_SEQUENTIAL);
theData.emplace_back(segment, filesizes[i]); theData.emplace_back(segment, filesizes[i]);
i += 1; i += 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment