[dpdk-dev] [EXTERNAL] Re: [PATCH v5 09/10] eal: add EAL argument for setting thread priority

Dmitry Malloy dmitrym at microsoft.com
Thu Apr 1 00:42:41 CEST 2021


The internal discussion was about the fact that this EAL parameter is:

a) optional
b) modifies default behavior (which is different on Windows or on Linux)

Unless admin decides to use this option - no one is regressed. This patch is not forcing a change in default behavior. It gives the admin a choice to change the priority. From this perspective - is see no problem with it.

Thanks,
Dmitry

-----Original Message-----
From: Stephen Hemminger <stephen at networkplumber.org> 
Sent: Wednesday, March 31, 2021 3:09 PM
To: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Cc: Narcisa Ana Maria Vasile <navasile at linux.microsoft.com>; dev at dpdk.org; thomas <thomas at monjalon.net>; Khoa To <khot at microsoft.com>; Narcisa Ana Maria Vasile <Narcisa.Vasile at microsoft.com>; Dmitry Malloy <dmitrym at microsoft.com>; Tyler Retzlaff <roretzla at microsoft.com>; talshn at nvidia.com; Omar Cardona <ocardona at microsoft.com>; bruce.richardson at intel.com; david.marchand at redhat.com; Kadam, Pallavi <pallavi.kadam at intel.com>
Subject: [EXTERNAL] Re: [dpdk-dev] [PATCH v5 09/10] eal: add EAL argument for setting thread priority

On Thu, 1 Apr 2021 00:12:54 +0300
Dmitry Kozlyuk <dmitry.kozliuk at gmail.com> wrote:

> 2021-03-30 14:11 (UTC-0700), Stephen Hemminger:
> > On Mon, 29 Mar 2021 15:40:39 -0700
> > Narcisa Ana Maria Vasile <navasile at linux.microsoft.com> wrote:
> >   
> > > From: Narcisa Vasile <navasile at microsoft.com>
> > > 
> > > Allow the user to choose the thread priority through an EAL 
> > > command line argument.
> > > 
> > > The user can select the thread priority to be either 'normal'
> > > or 'critical':
> > > --thread-prio normal
> > > --thread-prio realtime
> > > 
> > > Signed-off-by: Narcisa Vasile <navasile at microsoft.com>    
> > 
> > The discussion internally was that this was intended to resolve issues on Windows.
> > So it makes sense for Windows, but it is not something that we want to have on Linux.
> > Could you make this Windows only, and add update the documentation please.
> > 
> > I just don't want Linux users discovering it, trying it, then reporting more bugs.  
> 
> Can you share more details of that discussion?
> Is realtime-critical needed not for busy-polling apps (which indeed 
> cause starvation), but for interrupt-driven ones to process packets ASAP?
> 
> If it's true, then maybe NetUIO can instead give priority boost to 
> these threads when notifying them about interrupts (Omar? DmitryM?). 
> This can be configurable via devargs. One downside is that every 
> kernel driver has to support it, currently Mellanox bifurcated driver 
> and NetUIO. But they will need some interrupt-related IOCTLs anyway.


A DPDK application typically has cores detected to polling for packets.
The temptation is to set those cores to have a real time scheduling policy (SCHED_FIFO, or SCH_RR).  The problem is that those priorities run in preference to required kernel functions. So the polling-for-packets threads will starve out the Linux kernel RCU and softirq completion of I/O.  This starvation will lead to memory loss (no RCU cleanup) and potential deadlocks (disk I/O never completing).

It is possible to use real time priority on Linux but it requires lots of tuning to make sure that the kernel never runs work queues, interrupts or soft irqs on those cores. Lots of changes to /proc, kernel command line, and sysfs tunables. Which is possible on embedded systems but not for general purpose applications.

This is already a problem that shows up, but it only happens if the DPDK application writer explcitly calls the setscheduler on those threads.
At that point, it is the case where the user has started to manipulate threads, and we have to assume they know the consequences and are ready to deal with them.

On Windows, the situation is different so yes, this is necessary.


More information about the dev mailing list