DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Windows DPDK real-time priority threads causing thread starvation
@ 2020-12-09 14:15 Tal Shnaiderman
  2020-12-09 16:08 ` John Alexander
  2020-12-09 16:08 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Tal Shnaiderman @ 2020-12-09 14:15 UTC (permalink / raw)
  To: Dmitry Kozlyuk, Dmitry Malloy (MESHCHANINOV), Narcisa Ana Maria Vasile
  Cc: Eilon Greenstein, Omar Cardona, Rani Sharoni, Odi Assli,
	Harini Ramakrishnan, NBU-Contact-Thomas Monjalon, dev


During our verification tests on Windows DPDK we've noticed that DPDK polling threads, which run in REALTIME_PRIORITY_CLASS are causing starvation to other threads from the OS which need to change affinity and run in lower priority.

While running an application for a while we see the OS thread waits for 2:30 minutes and raises a bugcheck, see below example of such flow:

1) DPDK thread running on core-0 in real-time high priority(24) polling mode.
2) The thread is blocking the system function NtSetSystemInformation (ExpUpdateTimerConfiguration) in another thread from 
   switching to core-0 via KeSetSystemGroupAffinityThread since the calling thread is priority 15. 
3) NtSetSystemInformation exclusively acquired system-wide lock (ExpTimeRefreshLock) hence 
    it blocks other threads (e.g. calling NtQuerySystemInformation).

We've seen this behavior only while running on Windows 2019 VMs, maybe on native machines OS scheduling of such flow is done differently? 

Below is usage explanation from the documentation of SetPriorityClass [1]:

Process that has the highest possible priority. The threads of the process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive. 

So I assume using this kind of thread for a long period as we do can cause unstable behavior.

How do you think we can resolve this? Are there such cases in Linux?

[1] - https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setpriorityclass



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

end of thread, other threads:[~2020-12-16 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 14:15 [dpdk-dev] Windows DPDK real-time priority threads causing thread starvation Tal Shnaiderman
2020-12-09 16:08 ` John Alexander
2020-12-09 16:08 ` Stephen Hemminger
2020-12-09 16:12   ` [dpdk-dev] [EXTERNAL] " Dmitry Malloy (MESHCHANINOV)
2020-12-16 14:53     ` Tal Shnaiderman

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).