diff options
author | Noah Watkins <noahwatkins@gmail.com> | 2013-07-20 18:41:39 -0700 |
---|---|---|
committer | Noah Watkins <noahwatkins@gmail.com> | 2013-07-20 18:41:39 -0700 |
commit | e3a19d036e0acbd53feca97f20096c6fd7507125 (patch) | |
tree | 5aca2e2af3c1fe9ea3b38cba285dd8b192fe3528 | |
parent | 03f8c4d7acd5520f31d38a86d92da05be28be6ba (diff) | |
download | ceph-e3a19d036e0acbd53feca97f20096c6fd7507125.tar.gz |
wbthrottle: use posix_fadvise if available
Only adding information about data usage. This won't effect correctness;
finding analagous techniques on other platforms woudld be useful for
performance.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/os/WBThrottle.cc | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 692b39f14c3..b9b45b0dc41 100644 --- a/configure.ac +++ b/configure.ac @@ -541,6 +541,7 @@ AC_CHECK_HEADERS([linux/fs.h]) AC_CHECK_HEADERS([sys/disk.h]) AC_CHECK_HEADERS([sys/prctl.h]) AC_CHECK_FUNCS([prctl]) +AC_CHECK_FUNCS([posix_fadvise]) # Checks for typedefs, structures, and compiler characteristics. #AC_HEADER_STDBOOL diff --git a/src/os/WBThrottle.cc b/src/os/WBThrottle.cc index 23e24765cc2..69055ba9913 100644 --- a/src/os/WBThrottle.cc +++ b/src/os/WBThrottle.cc @@ -1,6 +1,8 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include <acconfig.h> + #include "os/WBThrottle.h" #include "common/perf_counters.h" @@ -146,8 +148,10 @@ void *WBThrottle::entry() clearing = wb.get<0>(); lock.Unlock(); ::fsync(**wb.get<1>()); +#ifdef HAVE_POSIX_FADVISE if (wb.get<2>().nocache) posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED); +#endif lock.Lock(); clearing = hobject_t(); cur_ios -= wb.get<2>().ios; |