From: Tal Shnaiderman Date: Thu, 18 Feb 2021 11:40:58 +0000 (+0200) Subject: eal/windows: fix default thread priority X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=16afcbfa30e9c2831264fb349457a4228fa687c8;p=dpdk.git eal/windows: fix default thread priority 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 Signed-off-by: Tal Shnaiderman Acked-by: Dmitry Kozlyuk --- 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); }