From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49A05A034F; Wed, 10 Nov 2021 04:04:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35BCA41123; Wed, 10 Nov 2021 04:04:19 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B54CC41103 for ; Wed, 10 Nov 2021 04:04:17 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1059) id 175B920C3535; Tue, 9 Nov 2021 19:04:17 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 175B920C3535 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1636513457; bh=En4bl5PdRvPlRRWzjby5HZUFLtzebCT4mIp+NoFvhPY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jXGHhQQfdo6uL+LdVEzw+VJJsaiT5nJ+joQ0PM4M3ugusgbtzMzCwrIioxMi8+ItX G3FtdgIZiioH2BFhf+RmwJWwCa/CZBgJJWCrnxnSxBi3JCL/LAQAb9hGYERJxusD3S DwWXnfF/YZPMD9QSLAODdui9xud4rJ4mC1/11TMk= Date: Tue, 9 Nov 2021 19:04:17 -0800 From: Narcisa Ana Maria Vasile To: Thomas Monjalon Cc: dev@dpdk.org, dmitry.kozliuk@gmail.com, khot@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com, bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com, stephen@networkplumber.org Message-ID: <20211110030417.GA7558@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1633732841-17873-1-git-send-email-navasile@linux.microsoft.com> <11591275.oo6G3FHbOz@thomas> <20211109015923.GB12569@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <6965604.4qUlQkvJ3b@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6965604.4qUlQkvJ3b@thomas> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v16 2/9] eal: add thread attributes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > > > > > > > > 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 > >