Skip to contentSkip to conversation

master - dmsetup: use timerfd for interval timing if available

PATCH Bryn Reeves 1 participant 1 message Aug 12, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a8b9e2eccdfccd63bc8816cea66f157b0257e351
Commit:        a8b9e2eccdfccd63bc8816cea66f157b0257e351
Parent:        99f55abc56bf1ce6b6f0e7d9cae67e347ace16b2
Author:        Bryn M. Reeves <[email protected]>
AuthorDate:    Sat Aug 8 23:59:06 2015 +0100
Committer:     Bryn M. Reeves <[email protected]>
CommitterDate: Wed Aug 12 15:09:57 2015 +0100

dmsetup: use timerfd for interval timing if available

If the Linux timerfd interface to POSIX timers is available at compile time use it for all report interval timekeeping. This gives more accurate interval timing when the per-interval processing time is less than the configured interval and simplifies the timestamp bookkeeping required to keep accurate time.

For systems without timerfd support fall back to the simple usleep based timer.

---
 configure               |    2 +-
 configure.in            |    2 +-
 lib/misc/configure.h.in |    3 +
 tools/dmsetup.c         |  325 +++++++++++++++++++++++++++++++++++++++++------
 4 files changed, 290 insertions(+), 42 deletions(-)
configure +1 -1
index b17e5a3..630f12a 100755
@@ -5734,7 +5734,7 @@ fi
 done
 
 
-for ac_header in termios.h sys/statvfs.h
+for ac_header in termios.h sys/statvfs.h sys/timerfd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
configure.in +1 -1
index 243b634..c3e55e9 100644
@@ -103,7 +103,7 @@ AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h \
   sys/time.h sys/types.h sys/utsname.h sys/wait.h time.h \
   unistd.h], , [AC_MSG_ERROR(bailing out)])
 
-AC_CHECK_HEADERS(termios.h sys/statvfs.h)
+AC_CHECK_HEADERS(termios.h sys/statvfs.h sys/timerfd.h)
 
 case "$host_os" in
 	linux*)
lib/misc/configure.h.in +3 -0
index 750c75c..0adb7b1 100644
@@ -516,6 +516,9 @@
 /* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H
 
+/* Define to 1 if you have the <sys/timerfd.h> header file. */
+#undef HAVE_SYS_TIMERFD_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
tools/dmsetup.c +285 -40

388 lines not on this page · raw message