Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit cba5243b2e61fb7215706bc6901ed1af0e4666a4:

  Only attempt file unlock if we use locking (2013-03-21 10:06:58 -0600)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (2):
      posixaio: restart suspend list after we have used aio_suspend()
      Consider the maximum block size difference the minimum for loop exit

Jianpeng Ma (1):
      mutex: fix the expression for checking the mutext magic

 backend.c          |    5 ++---
 engines/posixaio.c |    5 +++--
 fio.h              |    8 ++++++++
 mutex.c            |   16 ++++++++--------
 4 files changed, 21 insertions(+), 13 deletions(-)

---

Diff of recent changes:

diff --git a/backend.c b/backend.c
index 3567990..ae4216d 100644
--- a/backend.c
+++ b/backend.c
@@ -884,8 +884,7 @@ static int init_io_u(struct thread_data *td)
 	char *p;
 
 	max_units = td->o.iodepth;
-	max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
-	max_bs = max(td->o.max_bs[DDIR_TRIM], max_bs);
+	max_bs = td_max_bs(td);
 	min_write = td->o.min_bs[DDIR_WRITE];
 	td->orig_buffer_size = (unsigned long long) max_bs
 					* (unsigned long long) max_units;
@@ -1042,7 +1041,7 @@ static int keep_running(struct thread_data *td)
 		 * are done.
 		 */
 		diff = td->o.size - ddir_rw_sum(td->io_bytes);
-		if (diff < td->o.rw_min_bs)
+		if (diff < td_max_bs(td))
 			return 0;
 
 		return 1;
diff --git a/engines/posixaio.c b/engines/posixaio.c
index a943e5b..1858e52 100644
--- a/engines/posixaio.c
+++ b/engines/posixaio.c
@@ -98,7 +98,7 @@ static int fio_posixaio_getevents(struct thread_data *td, unsigned int min,
 	struct flist_head *entry;
 	struct timespec start;
 	int have_timeout = 0;
-	int suspend_entries = 0;
+	int suspend_entries;
 	unsigned int r;
 
 	if (t && !fill_timespec(&start))
@@ -107,8 +107,9 @@ static int fio_posixaio_getevents(struct thread_data *td, unsigned int min,
 		memset(&start, 0, sizeof(start));
 
 	r = 0;
-	memset(suspend_list, 0, sizeof(*suspend_list));
 restart:
+	memset(suspend_list, 0, sizeof(*suspend_list));
+	suspend_entries = 0;
 	flist_for_each(entry, &td->io_u_busylist) {
 		struct io_u *io_u = flist_entry(entry, struct io_u, list);
 		int err;
diff --git a/fio.h b/fio.h
index 4478eb6..621ed60 100644
--- a/fio.h
+++ b/fio.h
@@ -805,6 +805,14 @@ static inline int should_check_rate(struct thread_data *td,
 	return ret;
 }
 
+static inline unsigned int td_max_bs(struct thread_data *td)
+{
+	unsigned int max_bs;
+
+	max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
+	return max(td->o.max_bs[DDIR_TRIM], max_bs);
+}
+
 static inline int is_power_of_2(unsigned int val)
 {
 	return (val != 0 && ((val & (val - 1)) == 0));
diff --git a/mutex.c b/mutex.c
index af5e501..6022cdd 100644
--- a/mutex.c
+++ b/mutex.c
@@ -20,7 +20,7 @@
 
 void fio_mutex_remove(struct fio_mutex *mutex)
 {
-	assert(mutex->magic = FIO_MUTEX_MAGIC);
+	assert(mutex->magic == FIO_MUTEX_MAGIC);
 	pthread_cond_destroy(&mutex->cond);
 	munmap((void *) mutex, sizeof(*mutex));
 }
@@ -95,7 +95,7 @@ int fio_mutex_down_timeout(struct fio_mutex *mutex, unsigned int seconds)
 	struct timespec t;
 	int ret = 0;
 
-	assert(mutex->magic = FIO_MUTEX_MAGIC);
+	assert(mutex->magic == FIO_MUTEX_MAGIC);
 
 	gettimeofday(&tv_s, NULL);
 	t.tv_sec = tv_s.tv_sec + seconds;
@@ -127,7 +127,7 @@ int fio_mutex_down_timeout(struct fio_mutex *mutex, unsigned int seconds)
 
 void fio_mutex_down(struct fio_mutex *mutex)
 {
-	assert(mutex->magic = FIO_MUTEX_MAGIC);
+	assert(mutex->magic == FIO_MUTEX_MAGIC);
 
 	pthread_mutex_lock(&mutex->lock);
 
@@ -143,7 +143,7 @@ void fio_mutex_down(struct fio_mutex *mutex)
 
 void fio_mutex_up(struct fio_mutex *mutex)
 {
-	assert(mutex->magic = FIO_MUTEX_MAGIC);
+	assert(mutex->magic == FIO_MUTEX_MAGIC);
 
 	pthread_mutex_lock(&mutex->lock);
 	read_barrier();
@@ -155,25 +155,25 @@ void fio_mutex_up(struct fio_mutex *mutex)
 
 void fio_rwlock_write(struct fio_rwlock *lock)
 {
-	assert(lock->magic = FIO_RWLOCK_MAGIC);
+	assert(lock->magic == FIO_RWLOCK_MAGIC);
 	pthread_rwlock_wrlock(&lock->lock);
 }
 
 void fio_rwlock_read(struct fio_rwlock *lock)
 {
-	assert(lock->magic = FIO_RWLOCK_MAGIC);
+	assert(lock->magic == FIO_RWLOCK_MAGIC);
 	pthread_rwlock_rdlock(&lock->lock);
 }
 
 void fio_rwlock_unlock(struct fio_rwlock *lock)
 {
-	assert(lock->magic = FIO_RWLOCK_MAGIC);
+	assert(lock->magic == FIO_RWLOCK_MAGIC);
 	pthread_rwlock_unlock(&lock->lock);
 }
 
 void fio_rwlock_remove(struct fio_rwlock *lock)
 {
-	assert(lock->magic = FIO_RWLOCK_MAGIC);
+	assert(lock->magic == FIO_RWLOCK_MAGIC);
 	munmap((void *) lock, sizeof(*lock));
 }
 
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux