[PATCH] windowsaio: fix completion thread affinitization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




From 529b7725a90268694af24b7f2579fb6879ce01ab Mon Sep 17 00:00:00 2001
From: Bruce Cran <bruce.cran@xxxxxxxxxxx>
Date: Thu, 6 Oct 2016 03:13:54 +0000
Subject: [PATCH] windowsaio: fix completion thread affinitization

Affinitize the windowsaio completion threads to the same CPUs as the
submission threads.
---
 engines/windowsaio.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/engines/windowsaio.c b/engines/windowsaio.c
index 0e164b6..f5cb048 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");
 		}
 
-- 
2.9.3.windows.2


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux