Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Mar 10, 2018 Kbuild

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 582e2fd9acae207400bed4226ceda4ee02464136:

Merge branch 'disable_opt' of https://github.com/sitsofe/fio (2018-03-07 10:22:28 -0700)

are available in the git repository at:

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

for you to fetch changes up to e0b3258bde6f39ab3a9d178b56526b65e0e32a8d:

filesetup: Initialize all members of struct fio_file (2018-03-09 21:34:44 -0700)

----------------------------------------------------------------
Bart Van Assche (5):
Remove prof_io_ops.fill_io_u_off(), .fill_io_u_size() and .get_next_file()
Makefile: Rerun the configure script if it has been modified Declare debug_levels[] const
helper_thread: Initialize all helper_data members before using it
filesetup: Initialize all members of struct fio_file

Jens Axboe (5):
mutex: ensure that fio_mutex_up() holds mutex lock during wakeup
mutex: fix other locations where we are not waking within the lock
io_u: kill get_next_{offset,buflen} wrappers
io_u: 'is_random' can be a boolean
filesetup: don't round/adjust size for size_percent == 100

 Makefile        | 23 +++++++++++------------
 debug.h         |  2 +-
 filesetup.c     |  4 ++--
 helper_thread.c |  2 +-
 init.c          |  6 +++---
 io_u.c          | 57 ++++++++++++---------------------------------------------
 mutex.c         |  3 ++-
 profile.h       |  4 ----
 verify.c        |  2 +-
 workqueue.c     |  2 +-
 10 files changed, 34 insertions(+), 71 deletions(-)

---

Diff of recent changes:

Makefile +11 -12
index 19ba40a..d73b944 100644
@@ -4,19 +4,18 @@ endif
 
 VPATH := $(SRCDIR)
 
-ifneq ($(wildcard config-host.mak),)
-all:
-include config-host.mak
-config-host-mak: configure
-	@echo $@ is out-of-date, running configure
-	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
-else
-config-host.mak:
+all: fio
+
+config-host.mak: configure
+	@if [ ! -e "$@" ]; then					\
+	  echo "Running configure ...";				\
+	  ./configure;						\
+	else							\
+	  echo "$@ is out-of-date, running configure";		\
+	  sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh;	\
+	fi
+
 ifneq ($(MAKECMDGOALS),clean)
-	@echo "Running configure for you..."
-	@./configure
-endif
-all:
 include config-host.mak
 endif
 
debug.h +1 -1
index ac5f2cc..b8718dd 100644
@@ -53,7 +53,7 @@ struct debug_level {
 	unsigned long shift;
 	unsigned int jobno;
 };
-extern struct debug_level debug_levels[];
+extern const struct debug_level debug_levels[];
 
 extern unsigned long fio_debug;
 
filesetup.c +2 -2
index cced556..1a187ff 100644
@@ -1036,7 +1036,7 @@ int setup_files(struct thread_data *td)
 		if (f->io_size == -1ULL)
 			total_size = -1ULL;
 		else {
-                        if (o->size_percent) {
+                        if (o->size_percent && o->size_percent != 100) {
 				uint64_t file_size;
 
 				file_size = f->io_size + f->file_offset;
@@ -1481,7 +1481,7 @@ static struct fio_file *alloc_new_file(struct thread_data *td)
 	if (td_ioengine_flagged(td, FIO_NOFILEHASH))
 		f = calloc(1, sizeof(*f));
 	else
-		f = smalloc(sizeof(*f));
+		f = scalloc(1, sizeof(*f));
 	if (!f) {
 		assert(0);
 		return NULL;
helper_thread.c +1 -1
index 64e5a3c..b05f821 100644
@@ -156,7 +156,7 @@ int helper_thread_create(struct fio_mutex *startup_mutex, struct sk_out *sk_out)
 	struct helper_data *hd;
 	int ret;
 
-	hd = smalloc(sizeof(*hd));
+	hd = scalloc(1, sizeof(*hd));
 
 	setup_disk_util();
 	steadystate_setup();
init.c +3 -3
index 28061db..bb0627b 100644
@@ -2094,7 +2094,7 @@ static int fill_def_thread(void)
 static void show_debug_categories(void)
 {
 #ifdef FIO_INC_DEBUG
-	struct debug_level *dl = &debug_levels[0];
+	const struct debug_level *dl = &debug_levels[0];
 	int curlen, first = 1;
 
 	curlen = 0;
@@ -2184,7 +2184,7 @@ static void usage(const char *name)
 }
 
 #ifdef FIO_INC_DEBUG
-struct debug_level debug_levels[] = {
+const struct debug_level debug_levels[] = {
 	{ .name = "process",
 	  .help = "Process creation/exit logging",
 	  .shift = FD_PROCESS,
@@ -2262,7 +2262,7 @@ struct debug_level debug_levels[] = {
 
 static int set_debug(const char *string)
 {
-	struct debug_level *dl;
+	const struct debug_level *dl;
 	char *p = (char *) string;
 	char *opt;
 	int i;
io_u.c +12 -45

127 lines not on this page · raw message

mutex.c +2 -1
index 63229ed..acc88dc 100644
@@ -240,10 +240,11 @@ void fio_mutex_up(struct fio_mutex *mutex)
 	if (!mutex->value && mutex->waiters)
 		do_wake = 1;
 	mutex->value++;
-	pthread_mutex_unlock(&mutex->lock);
 
 	if (do_wake)
 		pthread_cond_signal(&mutex->cond);
+
+	pthread_mutex_unlock(&mutex->lock);
 }
 
 void fio_rwlock_write(struct fio_rwlock *lock)
profile.h +0 -4
index 8d1f757..414151e 100644
@@ -10,10 +10,6 @@ struct prof_io_ops {
 	int (*td_init)(struct thread_data *);
 	void (*td_exit)(struct thread_data *);
 
-	int (*fill_io_u_off)(struct thread_data *, struct io_u *, unsigned int *);
-	int (*fill_io_u_size)(struct thread_data *, struct io_u *, unsigned int);
-	struct fio_file *(*get_next_file)(struct thread_data *);
-
 	int (*io_u_lat)(struct thread_data *, uint64_t);
 };
 
verify.c +1 -1
index aeafdb5..d070f33 100644
@@ -748,9 +748,9 @@ int verify_io_u_async(struct thread_data *td, struct io_u **io_u_ptr)
 	}
 	flist_add_tail(&io_u->verify_list, &td->verify_list);
 	*io_u_ptr = NULL;
-	pthread_mutex_unlock(&td->io_u_lock);
 
 	pthread_cond_signal(&td->verify_cond);
+	pthread_mutex_unlock(&td->io_u_lock);
 	return 0;
 }
 
workqueue.c +1 -1
index 1131400..18ec198 100644
@@ -109,9 +109,9 @@ void workqueue_enqueue(struct workqueue *wq, struct workqueue_work *work)
 	flist_add_tail(&work->list, &sw->work_list);
 	sw->seq = ++wq->work_seq;
 	sw->flags &= ~SW_F_IDLE;
-	pthread_mutex_unlock(&sw->lock);
 
 	pthread_cond_signal(&sw->cond);
+	pthread_mutex_unlock(&sw->lock);
 }
 
 static void handle_list(struct submit_worker *sw, struct flist_head *list)