From 62a1c55418a5dbf8621247c4c9afc03b32390473 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Wed, 18 Jan 2017 12:02:08 -0800 Subject: [PATCH] Remove fadvise with direct IO read Summary: Remove the logic since we don't use buffer cache with direct IO. Resolve read regression we currently have. Closes https://github.com/facebook/rocksdb/pull/1782 Differential Revision: D4430408 Pulled By: yiwu-arbug fbshipit-source-id: 5557bba --- util/io_posix.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/util/io_posix.cc b/util/io_posix.cc index 9cf994a90..c108f6ec5 100644 --- a/util/io_posix.cc +++ b/util/io_posix.cc @@ -265,11 +265,6 @@ Status PosixRandomAccessFile::Read(uint64_t offset, size_t n, Slice* result, // An error: return a non-ok status s = IOError(filename_, errno); } - if (!use_direct_io()) { - // we need to fadvise away the entire range of pages because - // we do not want readahead pages to be cached. - Fadvise(fd_, 0, 0, POSIX_FADV_DONTNEED); // free OS pages - } *result = Slice(scratch, (r < 0) ? 0 : n - left); return s; }