windowsaio: fix completion thread affinitization
authorBruce Cran <bruce.cran@sandisk.com>
Thu, 6 Oct 2016 03:13:54 +0000 (03:13 +0000)
committerJens Axboe <axboe@fb.com>
Tue, 11 Oct 2016 22:04:22 +0000 (16:04 -0600)
Affinitize the windowsaio completion threads to the same CPUs as the
submission threads.

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

index 0e164b604b1b9b00c6a96601dbe1c57635a962e5..f5cb04838a31f70dc6cf801239e33df16800f54c 100644 (file)
@@ -113,10 +113,15 @@ static int fio_windowsaio_init(struct thread_data *td)
 
                if (!rc)
                {
+                       DWORD threadid;
+
                        ctx->iocp = hFile;
                        ctx->wd = wd;
-                       wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, NULL);
-                       if (wd->iothread == NULL)
+                       wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, &threadid);
+
+                       if (wd->iothread != NULL)
+                               fio_setaffinity(threadid, td->o.cpumask);
+                       else
                                log_err("windowsaio: failed to create io completion thread\n");
                }