Do not cache readahead-pages in the OS cache.
Summary: When posix_fadvise(offset, offset) is usedm it frees up only those pages in that specified range. But the filesystem could have done some read-aheads and those get cached in the OS cache. Do not cache readahead-pages in the OS cache. Test Plan: run db_bench benchmark. Reviewers: vamsi, heyongqiang Reviewed By: heyongqiang Differential Revision: https://reviews.facebook.net/D5379
This commit is contained in:
parent
7ecc5d4ad5
commit
4028ae7d31
@ -94,7 +94,9 @@ class PosixRandomAccessFile: public RandomAccessFile {
|
||||
s = IOError(filename_, errno);
|
||||
}
|
||||
if (!useOsBuffer) {
|
||||
posix_fadvise(fd_, offset, n, POSIX_FADV_DONTNEED); // free OS pages
|
||||
// we need to fadvise away the entire range of pages because
|
||||
// we do not want readahead pages to be cached.
|
||||
posix_fadvise(fd_, 0, 0, POSIX_FADV_DONTNEED); // free OS pages
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user