Line |
Branch |
Exec |
Source |
1 |
|
|
#include "feature.h" |
2 |
|
|
#include <sys/mman.h> |
3 |
|
|
#include "xadvise.h" |
4 |
|
|
#include "debug.h" |
5 |
|
|
|
6 |
|
1 |
int advise_sequential(void *addr, size_t len) |
7 |
|
|
{ |
8 |
|
1 |
BUG_ON(len == 0); |
9 |
|
|
|
10 |
|
|
#if HAVE_POSIX_MADVISE |
11 |
|
1 |
return posix_madvise(addr, len, POSIX_MADV_SEQUENTIAL); |
12 |
|
|
#else |
13 |
|
|
(void)addr; |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
// "The posix_madvise() function shall have no effect on the semantics |
17 |
|
|
// of access to memory in the specified range, although it may affect |
18 |
|
|
// the performance of access". Ergo, doing nothing is a valid fallback. |
19 |
|
|
return 0; |
20 |
|
|
} |
21 |
|
|
|