DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/windows: fix default thread priority
@ 2021-02-18 11:40 Tal Shnaiderman
  2021-03-09  8:30 ` Tal Shnaiderman
  2021-03-09 21:44 ` Dmitry Kozlyuk
  0 siblings, 2 replies; 4+ messages in thread
From: Tal Shnaiderman @ 2021-02-18 11:40 UTC (permalink / raw)
  To: dev
  Cc: thomas, pallavi.kadam, dmitry.kozliuk, navasile, dmitrym,
	david.marchand, stable

The hard-coded thread priority for Windows threads in eal
is REALTIME_PRIORITY_CLASS/THREAD_PRIORITY_TIME_CRITICAL.

This results in issues with DPDK threads causing OS thread starvation
and eventually a bugcheck.

The fix reduce the thread priority to
NORMAL_PRIORITY_CLASS/THREAD_PRIORITY_NORMAL.

Bugzilla ID: 600
Fixes: 53ffd9f080f ("eal/windows: add minimum viable code")
Cc: stable@dpdk.org

Reported-by: Odi Assli <odia@nvidia.com>
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
 lib/librte_eal/windows/eal_thread.c      | 4 ++--
 lib/librte_eal/windows/include/pthread.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index 908e726d16..9c3f6d69fd 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -134,8 +134,8 @@ eal_thread_create(pthread_t *thread)
 	if (!th)
 		return -1;
 
-	SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
-	SetThreadPriority(th, THREAD_PRIORITY_TIME_CRITICAL);
+	SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
+	SetThreadPriority(th, THREAD_PRIORITY_NORMAL);
 
 	return 0;
 }
diff --git a/lib/librte_eal/windows/include/pthread.h b/lib/librte_eal/windows/include/pthread.h
index fb11a07ce6..9aeab1fa70 100644
--- a/lib/librte_eal/windows/include/pthread.h
+++ b/lib/librte_eal/windows/include/pthread.h
@@ -137,8 +137,8 @@ pthread_create(void *threadid, const void *threadattr, void *threadfunc,
 	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
 		args, 0, (LPDWORD)threadid);
 	if (hThread) {
-		SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
-		SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
+		SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
+		SetThreadPriority(hThread, THREAD_PRIORITY_NORMAL);
 	}
 	return ((hThread != NULL) ? 0 : E_FAIL);
 }
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-16 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 11:40 [dpdk-dev] [PATCH] eal/windows: fix default thread priority Tal Shnaiderman
2021-03-09  8:30 ` Tal Shnaiderman
2021-03-09 21:44 ` Dmitry Kozlyuk
2021-03-16 11:41   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).