Recent changes

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

 



The following changes since commit 1d7f28e1ba1c7ca20bdc1d48b7fa04f7f1673093:

  Remove debug TRIM #error (2010-09-01 13:55:12 +0200)

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

Jens Axboe (3):
      Fix libaio prep
      Trim/discard fixes
      Fix assert

 engines/libaio.c |    2 --
 fio.c            |    5 +++++
 io_u.c           |    1 +
 iolog.h          |    2 +-
 trim.c           |   18 +++++++++---------
 verify.c         |   10 ++++++++--
 6 files changed, 24 insertions(+), 14 deletions(-)

---

Diff of recent changes:

diff --git a/engines/libaio.c b/engines/libaio.c
index 44b7dfa..44a7613 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -34,8 +34,6 @@ static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
 		io_prep_pwrite(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
 	else if (ddir_sync(io_u->ddir))
 		io_prep_fsync(&io_u->iocb, f->fd);
-	else
-		return 1;
 
 	return 0;
 }
diff --git a/fio.c b/fio.c
index c8de2ee..7b03250 100644
--- a/fio.c
+++ b/fio.c
@@ -38,6 +38,7 @@
 #include "hash.h"
 #include "smalloc.h"
 #include "verify.h"
+#include "trim.h"
 #include "diskutil.h"
 #include "cgroup.h"
 #include "profile.h"
@@ -579,6 +580,7 @@ static void do_io(struct thread_data *td)
 		td_set_runstate(td, TD_RUNNING);
 
 	while ( (td->o.read_iolog_file && !flist_empty(&td->io_log_list)) ||
+		(!flist_empty(&td->trim_list)) ||
 	        ((td->this_io_bytes[0] + td->this_io_bytes[1]) < td->o.size) ) {
 		struct timeval comp_time;
 		unsigned long bytes_done[2] = { 0, 0 };
@@ -734,6 +736,9 @@ sync_done:
 		}
 	}
 
+	if (td->trim_entries)
+		printf("trim entries %ld\n", td->trim_entries);
+
 	if (td->o.fill_device && td->error == ENOSPC) {
 		td->error = 0;
 		td->terminate = 1;
diff --git a/io_u.c b/io_u.c
index ea0d46c..a630817 100644
--- a/io_u.c
+++ b/io_u.c
@@ -964,6 +964,7 @@ again:
 	if (io_u) {
 		assert(io_u->flags & IO_U_F_FREE);
 		io_u->flags &= ~(IO_U_F_FREE | IO_U_F_FREE_DEF);
+		io_u->flags &= ~IO_U_F_TRIMMED;
 
 		io_u->error = 0;
 		flist_del(&io_u->list);
diff --git a/iolog.h b/iolog.h
index c59e6aa..c35ce1e 100644
--- a/iolog.h
+++ b/iolog.h
@@ -53,7 +53,7 @@ struct io_piece {
 	};
 	unsigned long long offset;
 	unsigned long len;
-	unsigned long flags;
+	unsigned int flags;
 	enum fio_ddir ddir;
 	union {
 		unsigned long delay;
diff --git a/trim.c b/trim.c
index cf42625..3da1e74 100644
--- a/trim.c
+++ b/trim.c
@@ -21,12 +21,15 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
 	if (io_u->file)
 		return 0;
 	if (flist_empty(&td->trim_list))
-		return 0;
+		return 1;
 
 	assert(td->trim_entries);
 	ipo = flist_entry(td->trim_list.next, struct io_piece, trim_list);
 	remove_trim_entry(td, ipo);
-	ipo->flags |= IP_F_TRIMMED;
+
+	io_u->offset = ipo->offset;
+	io_u->buflen = ipo->len;
+	io_u->file = ipo->file;
 
 	/*
 	 * If not verifying that trimmed ranges return zeroed data,
@@ -40,11 +43,9 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
 			rb_erase(&ipo->rb_node, &td->io_hist_tree);
 		}
 		td->io_hist_len--;
-	}
-
-	io_u->offset = ipo->offset;
-	io_u->buflen = ipo->len;
-	io_u->file = ipo->file;
+		free(ipo);
+	} else
+		ipo->flags |= IP_F_TRIMMED;
 
 	if (!fio_file_open(io_u->file)) {
 		int r = td_io_open_file(td, io_u->file);
@@ -56,13 +57,12 @@ int get_next_trim(struct thread_data *td, struct io_u *io_u)
 		}
 	}
 
-	get_file(ipo->file);
+	get_file(io_u->file);
 	assert(fio_file_open(io_u->file));
 	io_u->ddir = DDIR_TRIM;
 	io_u->xfer_buf = NULL;
 	io_u->xfer_buflen = io_u->buflen;
 
-	free(ipo);
 	dprint(FD_VERIFY, "get_next_trim: ret io_u %p\n", io_u);
 	return 0;
 }
diff --git a/verify.c b/verify.c
index 073eec5..f537553 100644
--- a/verify.c
+++ b/verify.c
@@ -498,8 +498,10 @@ static int verify_trimmed_io_u(struct thread_data *td, struct io_u *io_u)
 	if (!ret)
 		return 0;
 
-	log_err("trims: verify failed at file %s offset %llu, length %lu\n",
-			io_u->file->file_name, io_u->offset, io_u->buflen);
+	log_err("trim: verify failed at file %s offset %llu, length %lu"
+		", block offset %lu\n",
+			io_u->file->file_name, io_u->offset, io_u->buflen,
+			(p - io_u->buf));
 	return ret;
 }
 
@@ -816,9 +818,13 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u)
 
 		ipo = rb_entry(n, struct io_piece, rb_node);
 		rb_erase(n, &td->io_hist_tree);
+		assert(ipo->flags & IP_F_ONRB);
+		ipo->flags &= ~IP_F_ONRB;
 	} else if (!flist_empty(&td->io_hist_list)) {
 		ipo = flist_entry(td->io_hist_list.next, struct io_piece, list);
 		flist_del(&ipo->list);
+		assert(ipo->flags & IP_F_ONLIST);
+		ipo->flags &= ~IP_F_ONLIST;
 	}
 
 	if (ipo) {
--
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