X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=4437d196c0d5cdf2b5a9ce34c1982d353e7ea480;hp=8303dc626a5c69bbfb999c046cd16958566deaf2;hb=b2ee7647ee05604397672f6b7c1a804b07466270;hpb=8aab824f8a042e76c83902afa4a1e9a473467e29 diff --git a/backend.c b/backend.c index 8303dc62..4437d196 100644 --- a/backend.c +++ b/backend.c @@ -56,7 +56,6 @@ #include "lib/tp.h" static pthread_t disk_util_thread; -static struct fio_mutex *disk_thread_mutex; static pthread_cond_t du_cond; static pthread_mutex_t du_lock; @@ -2010,10 +2009,8 @@ static void *disk_thread_main(void *data) } ret = pthread_cond_timedwait(&du_cond, &du_lock, &ts); - if (ret != ETIMEDOUT) { - printf("disk thread should exit %d\n", ret); + if (ret != ETIMEDOUT) break; - } ret = update_io_ticks(); @@ -2030,14 +2027,11 @@ static int create_disk_util_thread(void) setup_disk_util(); - disk_thread_mutex = fio_mutex_init(FIO_MUTEX_LOCKED); - pthread_cond_init(&du_cond, NULL); pthread_mutex_init(&du_lock, NULL); ret = pthread_create(&disk_util_thread, NULL, disk_thread_main, NULL); if (ret) { - fio_mutex_remove(disk_thread_mutex); log_err("Can't create disk util thread: %s\n", strerror(ret)); return 1; } @@ -2079,6 +2073,7 @@ int fio_backend(void) set_genesis_time(); stat_init(); create_disk_util_thread(); + create_status_interval_thread(); cgroup_list = smalloc(sizeof(*cgroup_list)); INIT_FLIST_HEAD(cgroup_list); @@ -2086,6 +2081,7 @@ int fio_backend(void) run_threads(); wait_for_disk_thread_exit(); + wait_for_status_interval_thread_exit(); if (!fio_abort) { __show_run_stats(); @@ -2110,7 +2106,6 @@ int fio_backend(void) sfree(cgroup_mnt); fio_mutex_remove(startup_mutex); - fio_mutex_remove(disk_thread_mutex); stat_exit(); return exit_value; }