Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
remi
Commits
3a2fcd0e
Commit
3a2fcd0e
authored
Oct 10, 2018
by
Matthieu Dorier
Browse files
added use of madvise
parent
d33334a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/remi-client.cpp
View file @
3a2fcd0e
...
...
@@ -7,6 +7,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<sys/types.h>
#include
<sys/mman.h>
#include
<unistd.h>
#include
<fcntl.h>
#include
<sys/mman.h>
...
...
@@ -173,6 +174,8 @@ extern "C" int remi_fileset_migrate(
cleanup
();
return
REMI_ERR_ALLOCATION
;
}
// indicate sequential access
madvise
(
segment
,
size
,
MADV_SEQUENTIAL
);
// close file descriptor
close
(
fd
);
// insert the segment
...
...
src/remi-server.cpp
View file @
3a2fcd0e
...
...
@@ -8,6 +8,7 @@
#include
<stdlib.h>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<sys/mman.h>
#include
<unistd.h>
#include
<fcntl.h>
#include
<sys/mman.h>
...
...
@@ -120,6 +121,7 @@ struct remi_provider : public tl::provider<remi_provider> {
req
.
respond
(
result
);
return
;
}
madvise
(
segment
,
filesizes
[
i
],
MADV_SEQUENTIAL
);
theData
.
emplace_back
(
segment
,
filesizes
[
i
]);
i
+=
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment