Skip to content

Commit 1ea33a2

Browse files
authored
use fadvise correctly (taco-project#44)
Signed-off-by: charliecgxu <charliecgxu@tencent.com>
1 parent f0fe215 commit 1ea33a2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

csrc/transfer_ssd.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ void transfer_kv_blocks_ssd(
214214
throw std::runtime_error("Thread failed to open file: " +
215215
std::string(strerror(errno)));
216216
}
217-
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_WILLNEED);
217+
218+
if (!o_direct_flag) {
219+
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
220+
posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED);
221+
}
218222
fds[i].push_back(fd);
219223
}
220224
}

0 commit comments

Comments
 (0)