Flexible I/O Tester development
 help / color / mirror / Atom feed
* Alter the order of checking time exceeded vs getting an io_u
@ 2009-06-15 23:18 Radha Ramachandran
  2009-06-16  6:30 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Radha Ramachandran @ 2009-06-15 23:18 UTC (permalink / raw)
  To: fio

Hi,
I was hitting a case where fio would loop for ever even though the
runtime was exceeded if it had difficulty getting the io_u struct, so
I suggest this change to the code so it wld not loop forever:

>git diff
diff --git a/fio.c b/fio.c
index bb26062..4927f1c 100644
--- a/fio.c
+++ b/fio.c
@@ -442,18 +442,17 @@ static void do_verify(struct thread_data *td)
        while (!td->terminate) {
                int ret2, full;

-               io_u = __get_io_u(td);
-               if (!io_u)
-                       break;
-
                update_tv_cache(td);

                if (runtime_exceeded(td, &td->tv_cache)) {
-                       put_io_u(td, io_u);
                        td->terminate = 1;
                        break;
                }

+               io_u = __get_io_u(td);
+               if (!io_u)
+                       break;
+
                if (get_next_verify(td, io_u)) {
                        put_io_u(td, io_u);
                        break;
@@ -580,18 +579,17 @@ static void do_io(struct thread_data *td)
                if (td->terminate)
                        break;

-               io_u = get_io_u(td);
-               if (!io_u)
-                       break;
-
                update_tv_cache(td);

                if (runtime_exceeded(td, &td->tv_cache)) {
-                       put_io_u(td, io_u);
                        td->terminate = 1;
                        break;
                }

+               io_u = get_io_u(td);
+               if (!io_u)
+                       break;
+
                /*
                 * Add verification end_io handler, if asked to verify
                 * a previously written file.


thanks
-radha

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-16  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-15 23:18 Alter the order of checking time exceeded vs getting an io_u Radha Ramachandran
2009-06-16  6:30 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox