From: Bruce Cran Date: Thu, 6 Oct 2016 03:13:54 +0000 (+0000) Subject: windowsaio: fix completion thread affinitization X-Git-Tag: fio-2.15~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=438bb1cf6c722ab2d83cce926bb94890af58c13a windowsaio: fix completion thread affinitization Affinitize the windowsaio completion threads to the same CPUs as the submission threads. Signed-off-by: Jens Axboe --- diff --git a/engines/windowsaio.c b/engines/windowsaio.c index 0e164b60..f5cb0483 100644 --- a/engines/windowsaio.c +++ b/engines/windowsaio.c @@ -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"); }