From 09c1aa8b322765afae56ea1ebc9eaa06f94da6a6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 17 Aug 2020 15:42:16 -0700 Subject: [PATCH] engines/windowsaio: only set IOCP thread affinity if specified 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 --- engines/windowsaio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/windowsaio.c b/engines/windowsaio.c index 13d7f194..ff8b6e1b 100644 --- a/engines/windowsaio.c +++ b/engines/windowsaio.c @@ -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"); -- 2.25.1