From: Vincent Fu Date: Tue, 28 Apr 2020 17:27:14 +0000 (-0600) Subject: helper_thread: cleanups X-Git-Tag: fio-3.20~24^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=0e59dd68fcce7a5c77ba5bf1239d79a28c4006a0;p=fio.git helper_thread: cleanups - instead of always using a timeout of DISK_UTIL_MSEC, use a possibly shorter period for the select() timeout - drop the timespec_add_msec() call because the target is overwritten in short order by clock_gettime() Signed-off-by: Vincent Fu --- diff --git a/helper_thread.c b/helper_thread.c index 78749855..90bfab5c 100644 --- a/helper_thread.c +++ b/helper_thread.c @@ -164,13 +164,11 @@ static void *helper_thread_main(void *data) while (!ret && !hd->exit) { uint64_t since_du, since_ss = 0; struct timeval timeout = { - .tv_sec = DISK_UTIL_MSEC / 1000, - .tv_usec = (DISK_UTIL_MSEC % 1000) * 1000, + .tv_sec = msec_to_next_event / 1000, + .tv_usec = (msec_to_next_event % 1000) * 1000, }; fd_set rfds, efds; - timespec_add_msec(&ts, msec_to_next_event); - if (read_from_pipe(hd->pipe[0], &action, sizeof(action)) < 0) { FD_ZERO(&rfds); FD_SET(hd->pipe[0], &rfds);