On Tue, Nov 09, 2021 at 09:27:09AM +0100, Thomas Monjalon wrote: > 09/11/2021 02:59, Narcisa Ana Maria Vasile: > > On Tue, Oct 12, 2021 at 06:12:21PM +0200, Thomas Monjalon wrote: > > > 09/10/2021 09:41, Narcisa Ana Maria Vasile: > > > > From: Narcisa Vasile <navas...@microsoft.com> > > > > > > > > Implement thread attributes for: > > > > * thread affinity > > > > * thread priority > > > > Implement functions for managing thread attributes. > > > > > > > > Priority is represented through an enum that allows for two levels: > > > > - RTE_THREAD_PRIORITY_NORMAL > > > > - RTE_THREAD_PRIORITY_REALTIME_CRITICAL > > > > > > It doesn't say how do you translate these priorites in POSIX and win32. > > > > I'll send a new version with a better commit message. > > Thread priorities on both Linux-based and Windows platforms are similarly > > constructed from a class/policy + priority value. Currently in DPDK, most > > threads > > operate at the OS-default priority level but there are cases when > > increasing the > > priority is useful. For example, the Mellanox data path acceleration > > driver requires > > realtime thread priority. Similarly, some Windows applications will > > require elevated > > priority. > > It should not. We should not use realtime priority.
Thomas, can you join the community sync tomorrow? I'll bring this up to discuss. High performance applications benefit from an option to raise the priority of their threads to avoid being preemted by other threads on the system. If there are issues with realtime priority on some of the platforms, maybe we can add a warning for the user to make them aware of possible crashes as Stephen H. suggested some time ago. Note that this patch doesn't change the priority of EAL threads, enabling the higher priority will be done through a command line option when starting the application. Maybe we can explore raising the priority but not to the realtime level. > > > For these reasons, EAL will advertise 2 priority levels which are named > > suggestively > > "normal" and "realtime_critical" and are computed as follows: > > > > For Linux and similar platforms: > > * EAL "normal" priority corresponds to the (default) SCHED_OTHER policy > > + a priority value of > > (sched_get_priority_min(SCHED_OTHER) + > > sched_get_priority_max(SCHED_OTHER))/2. > > Note that on Linux the resulting priority value will be 0, > > in accordance to the docs guidance that mention the value should be 0 > > for SCHED_OTHER policy. > > > > * EAL "realtime" priority corresponds to the SCHED_RR policy + a > > priority value of > > sched_get_priority_max(SCHED_RR); > > > > For Windows: > > * EAL "normal" corresponds to class NORMAL_PRIORITY_CLASS + > > priority THREAD_PRIORITY_NORMAL > > * EAL "realtime_critical" corresponds to class REALTIME_PRIORITY_CLASS + > > priority THREAD_PRIORITY_TIME_CRITICAL > >