Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Oct 11, 2020

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 729071019ee23804d52bed47357e4324be6b06bf:

Merge branch 'master' of https://github.com/chengli-rutgers/fio into master (2020-10-09 07:28:55 -0600)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 60c52212520b905a1740d3c8815c34cc48471c5c:

Merge branch 'master' of https://github.com/bvanassche/fio into master (2020-10-10 20:30:52 -0600)

----------------------------------------------------------------
Alexey Dobriyan (1):
simplify MB/s, IOPS interactive printout code

Bart Van Assche (9):
configure: Remove the CLOCK_MONOTONIC_PRECISE probe
gettime: Introduce fio_get_mono_time()
gettime: Simplify get_cycles_per_msec()
gettime: Introduce rel_time_since()
helper_thread: Introduce a function for blocking Unix signals
helper_thread: Introduce the wait_for_action() function Change the return value of two functions from 'void' into 'int'
helper_thread: Rework the interval timer code
helper_thread: Increase timer accuracy

Jens Axboe (3):
flow: avoid holes in struct fio_flow
flow: use unsigned long for the counter
Merge branch 'master' of https://github.com/bvanassche/fio into master

 configure          |  61 ++++--------
 engines/posixaio.c |  41 +-------
 eta.c              |  70 +++++--------
 fio_time.h         |   2 +
 flow.c             |   6 +-
 gettime.c          |  76 ++++++++------
 gettime.h          |   1 +
 helper_thread.c    | 285 ++++++++++++++++++++++++++++++++++++-----------------
 stat.c             |   4 +-
 stat.h             |   2 +-
 steadystate.c      |   3 +-
 steadystate.h      |   2 +-
 12 files changed, 306 insertions(+), 247 deletions(-)

---

Diff of recent changes:

configure +21 -40
index 12b7cb58..39a9248d 100755
@@ -1104,46 +1104,6 @@ EOF
 fi
 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
 
-##########################################
-# CLOCK_MONOTONIC_RAW probe
-if test "$clock_monotonic_raw" != "yes" ; then
-  clock_monotonic_raw="no"
-fi
-if test "$clock_gettime" = "yes" ; then
-  cat > $TMPC << EOF
-#include <stdio.h>
-#include <time.h>
-int main(int argc, char **argv)
-{
-  return clock_gettime(CLOCK_MONOTONIC_RAW, NULL);
-}
-EOF
-  if compile_prog "" "$LIBS" "clock monotonic"; then
-      clock_monotonic_raw="yes"
-  fi
-fi
-print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
-
-##########################################
-# CLOCK_MONOTONIC_PRECISE probe
-if test "$clock_monotonic_precise" != "yes" ; then
-  clock_monotonic_precise="no"
-fi
-if test "$clock_gettime" = "yes" ; then
-  cat > $TMPC << EOF
-#include <stdio.h>
-#include <time.h>
-int main(int argc, char **argv)
-{
-  return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
-}
-EOF
-  if compile_prog "" "$LIBS" "clock monotonic precise"; then
-      clock_monotonic_precise="yes"
-  fi
-fi
-print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
-
 ##########################################
 # clockid_t probe
 if test "$clockid_t" != "yes" ; then
@@ -2722,6 +2682,24 @@ else
   pdb=no
 fi
 print_config "Windows PDB generation" "$pdb"
+
+##########################################
+# check for timerfd support
+timerfd_create="no"
+cat > $TMPC << EOF
+#include <sys/time.h>
+#include <sys/timerfd.h>
+
+int main(int argc, char **argv)
+{
+	return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
+}
+EOF
+if compile_prog "" "" "timerfd_create"; then
+  timerfd_create="yes"
+fi
+print_config "timerfd_create" "$timerfd_create"
+
 #############################################################################
 
 if test "$wordsize" = "64" ; then
@@ -3023,6 +3001,9 @@ fi
 if test "$statx_syscall" = "yes"; then
   output_sym "CONFIG_HAVE_STATX_SYSCALL"
 fi
+if test "$timerfd_create" = "yes"; then
+  output_sym "CONFIG_HAVE_TIMERFD_CREATE"
+fi
 if test "$fallthrough" = "yes"; then
   CFLAGS="$CFLAGS -Wimplicit-fallthrough"
 fi
engines/posixaio.c +4 -37

58 lines not on this page · raw message

eta.c +26 -44

82 lines not on this page · raw message

fio_time.h +2 -0
index c00f8e78..b3bbd4c0 100644
@@ -13,6 +13,8 @@ extern uint64_t ntime_since(const struct timespec *, const struct timespec *);
 extern uint64_t ntime_since_now(const struct timespec *);
 extern uint64_t utime_since(const struct timespec *, const struct timespec *);
 extern uint64_t utime_since_now(const struct timespec *);
+extern int64_t rel_time_since(const struct timespec *,
+			      const struct timespec *);
 extern uint64_t mtime_since(const struct timespec *, const struct timespec *);
 extern uint64_t mtime_since_now(const struct timespec *);
 extern uint64_t mtime_since_tv(const struct timeval *, const struct timeval *);
flow.c +3 -3
index ee4d761d..ea6b0ec9 100644
@@ -5,9 +5,9 @@
 
 struct fio_flow {
 	unsigned int refs;
-	struct flist_head list;
 	unsigned int id;
-	unsigned long long flow_counter;
+	struct flist_head list;
+	unsigned long flow_counter;
 	unsigned int total_weight;
 };
 
@@ -90,7 +90,7 @@ static struct fio_flow *flow_get(unsigned int id)
 	return flow;
 }
 
-static void flow_put(struct fio_flow *flow, unsigned long long flow_counter,
+static void flow_put(struct fio_flow *flow, unsigned long flow_counter,
 				        unsigned int weight)
 {
 	if (!flow_lock)
gettime.c +47 -29

122 lines not on this page · raw message

gettime.h +1 -0
index c55f5cba..f1d619ad 100644
@@ -16,6 +16,7 @@ enum fio_cs {
 	CS_INVAL,
 };
 
+extern int fio_get_mono_time(struct timespec *);
 extern void fio_gettime(struct timespec *, void *);
 extern void fio_gtod_init(void);
 extern void fio_clock_init(void);
helper_thread.c +195 -90

345 lines not on this page · raw message

stat.c +3 -1
index 7f987c7f..eb40bd7f 100644
@@ -2299,7 +2299,7 @@ void __show_run_stats(void)
 	free(opt_lists);
 }
 
-void __show_running_run_stats(void)
+int __show_running_run_stats(void)
 {
 	struct thread_data *td;
 	unsigned long long *rt;
@@ -2350,6 +2350,8 @@ void __show_running_run_stats(void)
 
 	free(rt);
 	fio_sem_up(stat_sem);
+
+	return 0;
 }
 
 static bool status_file_disabled;
stat.h +1 -1
index 0d141666..6dd5ef74 100644
@@ -319,7 +319,7 @@ extern void show_group_stats(struct group_run_stats *rs, struct buf_output *);
 extern bool calc_thread_status(struct jobs_eta *je, int force);
 extern void display_thread_status(struct jobs_eta *je);
 extern void __show_run_stats(void);
-extern void __show_running_run_stats(void);
+extern int __show_running_run_stats(void);
 extern void show_running_run_stats(void);
 extern void check_for_running_stats(void);
 extern void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src, bool first);
steadystate.c +2 -1
index bd2f70dd..2e3da1db 100644
@@ -196,7 +196,7 @@ static bool steadystate_deviation(uint64_t iops, uint64_t bw,
 	return false;
 }
 
-void steadystate_check(void)
+int steadystate_check(void)
 {
 	int i, j, ddir, prev_groupid, group_ramp_time_over = 0;
 	unsigned long rate_time;
@@ -302,6 +302,7 @@ void steadystate_check(void)
 			}
 		}
 	}
+	return 0;
 }
 
 int td_steadystate_init(struct thread_data *td)
steadystate.h +1 -1
index 51472c46..bbb86fbb 100644
@@ -4,7 +4,7 @@
 #include "thread_options.h"
 
 extern void steadystate_free(struct thread_data *);
-extern void steadystate_check(void);
+extern int steadystate_check(void);
 extern void steadystate_setup(void);
 extern int td_steadystate_init(struct thread_data *);
 extern uint64_t steadystate_bw_mean(struct thread_stat *);