summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2013-07-20 18:41:39 -0700
committerNoah Watkins <noahwatkins@gmail.com>2013-09-17 10:16:18 -0700
commit4670b0f14f009d1f5c19f5c3bce3bd5b9127e14b (patch)
treecfbd380525985f01b9a347acaa54be03396ab17d
parentb5c62eabd1de86dce7a23b3223070ebc0e70254d (diff)
downloadceph-4670b0f14f009d1f5c19f5c3bce3bd5b9127e14b.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.ac1
-rw-r--r--src/os/WBThrottle.cc4
2 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b80cafe6fb3..1eba33d5428 100644
--- a/configure.ac
+++ b/configure.ac
@@ -555,6 +555,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 8479b3c878d..ba95b9b4284 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();
::fdatasync(**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;