Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Aug 24, 2022

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit d33c7846cc5f175177e194a5489282780e2a04c4:

Merge branch 'clarify-io-errors' of https://github.com/Hi-Angel/fio (2022-08-16 19:54:17 -0600)

are available in the Git repository at:

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

for you to fetch changes up to 995c45c08c7a362ae0fb2e54e2de27b555a757ab:

Merge branch 'sigbreak-wait' of github.com:bjpaupor/fio (2022-08-23 17:09:25 -0400)

----------------------------------------------------------------
Brandon Paupore (1):
Add wait for handling SIGBREAK

Vincent Fu (3):
Revert "Minor style fixups"
Revert "Fix multithread issues when operating on a single shared file" Merge branch 'sigbreak-wait' of github.com:bjpaupor/fio

 backend.c   | 40 +++++++++++++++++++++-------------------
 file.h      |  1 -
 filesetup.c | 45 ++-------------------------------------------
 3 files changed, 23 insertions(+), 63 deletions(-)

---

Diff of recent changes:

backend.c +21 -19
index 5159b60d..375a23e4 100644
@@ -90,6 +90,25 @@ static void sig_int(int sig)
 	}
 }
 
+#ifdef WIN32
+static void sig_break(int sig)
+{
+	struct thread_data *td;
+	int i;
+
+	sig_int(sig);
+
+	/**
+	 * Windows terminates all job processes on SIGBREAK after the handler
+	 * returns, so give them time to wrap-up and give stats
+	 */
+	for_each_td(td, i) {
+		while (td->runstate < TD_EXITED)
+			sleep(1);
+	}
+}
+#endif
+
 void sig_show_status(int sig)
 {
 	show_running_run_stats();
@@ -112,7 +131,7 @@ static void set_sig_handlers(void)
 /* Windows uses SIGBREAK as a quit signal from other applications */
 #ifdef WIN32
 	memset(&act, 0, sizeof(act));
-	act.sa_handler = sig_int;
+	act.sa_handler = sig_break;
 	act.sa_flags = SA_RESTART;
 	sigaction(SIGBREAK, &act, NULL);
 #endif
@@ -2314,25 +2333,8 @@ static void run_threads(struct sk_out *sk_out)
 	for_each_td(td, i) {
 		print_status_init(td->thread_number - 1);
 
-		if (!td->o.create_serialize) {
-			/*
-			 *  When operating on a single rile in parallel,
-			 *  perform single-threaded early setup so that
-			 *  when setup_files() does not run into issues
-			 *  later.
-			*/
-			if (!i && td->o.nr_files == 1) {
-				if (setup_shared_file(td)) {
-					exit_value++;
-					if (td->error)
-						log_err("fio: pid=%d, err=%d/%s\n",
-							(int) td->pid, td->error, td->verror);
-					td_set_runstate(td, TD_REAPED);
-					todo--;
-				}
-			}
+		if (!td->o.create_serialize)
 			continue;
-		}
 
 		if (fio_verify_load_state(td))
 			goto reap;
file.h +0 -1
index e646cf22..da1b8947 100644
@@ -201,7 +201,6 @@ struct thread_data;
 extern void close_files(struct thread_data *);
 extern void close_and_free_files(struct thread_data *);
 extern uint64_t get_start_offset(struct thread_data *, struct fio_file *);
-extern int __must_check setup_shared_file(struct thread_data *);
 extern int __must_check setup_files(struct thread_data *);
 extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
 #ifdef __cplusplus
filesetup.c +2 -43

69 lines not on this page · raw message