engines/windowsaio: only set IOCP thread affinity if specified
authorJens Axboe <axboe@kernel.dk>
Mon, 17 Aug 2020 22:42:16 +0000 (15:42 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 17 Aug 2020 22:42:16 +0000 (15:42 -0700)
We set it by default, which seems like a bad idea. If the issuing
thread is running on some other CPU, we don't want to bind this
to what is probably CPU0.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/windowsaio.c

index 13d7f19402a1759fa8c28f7e11b6e13686098e93..ff8b6e1b3e62331078108bae8dfd79cf850f7967 100644 (file)
@@ -107,7 +107,8 @@ static int fio_windowsaio_init(struct thread_data *td)
                        ctx->wd = wd;
                        wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, &threadid);
 
-                       if (wd->iothread != NULL)
+                       if (wd->iothread != NULL &&
+                           fio_option_is_set(&td->o, cpumask))
                                fio_setaffinity(threadid, td->o.cpumask);
                        else
                                log_err("windowsaio: failed to create io completion thread\n");