Merge branch 'histogram-client-server' of https://github.com/cronburg/fio
authorJens Axboe <axboe@fb.com>
Fri, 2 Sep 2016 17:24:15 +0000 (11:24 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 2 Sep 2016 17:24:15 +0000 (11:24 -0600)
FIO-VERSION-GEN
backend.c
examples/jesd219.fio
file.h
filelock.c
filelock.h
filesetup.c
io_u.c
trim.c
trim.h

index 7065a5790e2051bc05973d99e58803742147aef5..d19dccacdbdfacb966c84c7e6d12aa9673da57d7 100755 (executable)
@@ -15,7 +15,7 @@ elif test -d .git -o -f .git &&
        VN=`git describe --match "fio-[0-9]*" --abbrev=4 HEAD 2>/dev/null` &&
        case "$VN" in
        *$LF*) (exit 1) ;;
-       v[0-9]*)
+       fio-[0-9]*)
                git update-index -q --refresh
                test -z "`git diff-index --name-only HEAD --`" ||
                VN="$VN-dirty" ;;
@@ -38,5 +38,3 @@ test "$VN" = "$VC" || {
        echo >&2 "FIO_VERSION = $VN"
        echo "FIO_VERSION = $VN" >$GVF
 }
-
-
index d98658606d772ed7d31b1355571ee2566b53a213..fb2a8551e396227fc01ed5849e95fbd0e15c38a8 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1731,9 +1731,13 @@ static void *thread_main(void *data)
                 * the rusage_sem, which would never get upped because
                 * this thread is waiting for the stat mutex.
                 */
-               check_update_rusage(td);
+               do {
+                       check_update_rusage(td);
+                       if (!fio_mutex_down_trylock(stat_mutex))
+                               break;
+                       usleep(1000);
+               } while (1);
 
-               fio_mutex_down(stat_mutex);
                if (td_read(td) && td->io_bytes[DDIR_READ])
                        update_runtime(td, elapsed_us, DDIR_READ);
                if (td_write(td) && td->io_bytes[DDIR_WRITE])
index ab2c40e2957de256f610cc0bc23a7b7a8b19c906..24f16f77e93bfba1b177b93844be31ab93deb92e 100644 (file)
@@ -14,6 +14,7 @@ rwmixwrite=60
 iodepth=256
 numjobs=4
 bssplit=512/4:1024/1:1536/1:2048/1:2560/1:3072/1:3584/1:4k/67:8k/10:16k/7:32k/3:64k/3
+blockalign=4k
 random_distribution=zoned:50/5:30/15:20/80
 filename=/dev/nvme0n1
 group_reporting=1
diff --git a/file.h b/file.h
index aff3ce9f301dcf004473af965d6c84cdba993ed3..6f34dd5c3d315608778f638e6be45ef7f4726cd1 100644 (file)
--- a/file.h
+++ b/file.h
@@ -210,7 +210,7 @@ extern int get_fileno(struct thread_data *, const char *);
 extern void free_release_files(struct thread_data *);
 extern void filesetup_mem_free(void);
 extern void fio_file_reset(struct thread_data *, struct fio_file *);
-extern int fio_files_done(struct thread_data *);
+extern bool fio_files_done(struct thread_data *);
 extern bool exists_and_not_regfile(const char *);
 
 #endif
index b1130071ea982ad38e7277ec6c0b7886f4c84bf2..6e84970fc0064cafaeb0945befd5f4355fd9cf7b 100644 (file)
@@ -165,7 +165,7 @@ static struct fio_filelock *fio_hash_get(uint32_t hash, int trylock)
        return ff;
 }
 
-static int __fio_lock_file(const char *fname, int trylock)
+static bool __fio_lock_file(const char *fname, int trylock)
 {
        struct fio_filelock *ff;
        uint32_t hash;
@@ -180,16 +180,16 @@ static int __fio_lock_file(const char *fname, int trylock)
 
        if (!ff) {
                assert(!trylock);
-               return 1;
+               return true;
        }
 
        if (!trylock) {
                fio_mutex_down(&ff->lock);
-               return 0;
+               return false;
        }
 
        if (!fio_mutex_down_trylock(&ff->lock))
-               return 0;
+               return false;
 
        fio_mutex_down(&fld->lock);
 
@@ -206,13 +206,13 @@ static int __fio_lock_file(const char *fname, int trylock)
 
        if (ff) {
                fio_mutex_down(&ff->lock);
-               return 0;
+               return false;
        }
 
-       return 1;
+       return true;
 }
 
-int fio_trylock_file(const char *fname)
+bool fio_trylock_file(const char *fname)
 {
        return __fio_lock_file(fname, 1);
 }
index 97d13b7a62f1a62e7dbd6fc4d591588c865831a5..4551bb0427ec6fc12e726bb4161b50ad98d79c40 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef FIO_LOCK_FILE_H
 #define FIO_LOCK_FILE_H
 
+#include "lib/types.h"
+
 extern void fio_lock_file(const char *);
-extern int fio_trylock_file(const char *);
+extern bool fio_trylock_file(const char *);
 extern void fio_unlock_file(const char *);
 
 extern int fio_filelock_init(void);
index fc9f3067226ee48276071af7343659a939cef43e..c6ef3bf2744f52a70e8bf845a65d4877ed7e8e4b 100644 (file)
@@ -1292,7 +1292,6 @@ static void set_already_allocated(const char *fname)
        }
 }
 
-
 static void free_already_allocated(void)
 {
        struct flist_head *entry, *tmp;
@@ -1666,16 +1665,16 @@ void fio_file_reset(struct thread_data *td, struct fio_file *f)
                lfsr_reset(&f->lfsr, td->rand_seeds[FIO_RAND_BLOCK_OFF]);
 }
 
-int fio_files_done(struct thread_data *td)
+bool fio_files_done(struct thread_data *td)
 {
        struct fio_file *f;
        unsigned int i;
 
        for_each_file(td, f, i)
                if (!fio_file_done(f))
-                       return 0;
+                       return false;
 
-       return 1;
+       return true;
 }
 
 /* free memory used in initialization phase only */
diff --git a/io_u.c b/io_u.c
index dcf7a40562531af0a55cd56ddb7d02a00527bdd6..b6d530f2a23a542d28673587ababf8a0e091f3e9 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1510,7 +1510,7 @@ static bool check_get_trim(struct thread_data *td, struct io_u *io_u)
                        get_trim = 1;
                }
 
-               if (get_trim && !get_next_trim(td, io_u))
+               if (get_trim && get_next_trim(td, io_u))
                        return true;
        }
 
diff --git a/trim.c b/trim.c
index 434554129453915515a5b64d47bbed6e914bf765..78cf67244efa22534604fd6b6652379457a571a2 100644 (file)
--- a/trim.c
+++ b/trim.c
@@ -11,7 +11,7 @@
 #include "trim.h"
 
 #ifdef FIO_HAVE_TRIM
-int get_next_trim(struct thread_data *td, struct io_u *io_u)
+bool get_next_trim(struct thread_data *td, struct io_u *io_u)
 {
        struct io_piece *ipo;
 
@@ -19,9 +19,9 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
         * this io_u is from a requeue, we already filled the offsets
         */
        if (io_u->file)
-               return 0;
+               return true;
        if (flist_empty(&td->trim_list))
-               return 1;
+               return false;
 
        assert(td->trim_entries);
        ipo = flist_first_entry(&td->trim_list, struct io_piece, trim_list);
@@ -53,7 +53,7 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
                if (r) {
                        dprint(FD_VERIFY, "failed file %s open\n",
                                        io_u->file->file_name);
-                       return 1;
+                       return false;
                }
        }
 
@@ -64,17 +64,17 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
        io_u->xfer_buflen = io_u->buflen;
 
        dprint(FD_VERIFY, "get_next_trim: ret io_u %p\n", io_u);
-       return 0;
+       return true;
 }
 
-int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
+bool io_u_should_trim(struct thread_data *td, struct io_u *io_u)
 {
        unsigned long long val;
        uint64_t frand_max;
        unsigned long r;
 
        if (!td->o.trim_percentage)
-               return 0;
+               return false;
 
        frand_max = rand_max(&td->trim_state);
        r = __rand(&td->trim_state);
diff --git a/trim.h b/trim.h
index 6584606253f8edcab29e65d70f6bf23a6d49bc8d..37f5d7c871127a8bf5858a3fda620684a0e8438d 100644 (file)
--- a/trim.h
+++ b/trim.h
@@ -4,8 +4,8 @@
 #include "fio.h"
 
 #ifdef FIO_HAVE_TRIM
-extern int __must_check get_next_trim(struct thread_data *td, struct io_u *io_u);
-extern int io_u_should_trim(struct thread_data *td, struct io_u *io_u);
+extern bool __must_check get_next_trim(struct thread_data *td, struct io_u *io_u);
+extern bool io_u_should_trim(struct thread_data *td, struct io_u *io_u);
 
 /*
  * Determine whether a given io_u should be logged for verify or
@@ -20,13 +20,13 @@ static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ip
 }
 
 #else
-static inline int get_next_trim(struct thread_data *td, struct io_u *io_u)
+static inline bool get_next_trim(struct thread_data *td, struct io_u *io_u)
 {
-       return 1;
+       return false;
 }
-static inline int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
+static inline bool io_u_should_trim(struct thread_data *td, struct io_u *io_u)
 {
-       return 0;
+       return false;
 }
 static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo)
 {