From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DF6E8A0C4B;
	Tue,  9 Nov 2021 09:27:14 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6C6C240687;
	Tue,  9 Nov 2021 09:27:14 +0100 (CET)
Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com
 [66.111.4.229]) by mails.dpdk.org (Postfix) with ESMTP id C3CAE40151
 for <dev@dpdk.org>; Tue,  9 Nov 2021 09:27:12 +0100 (CET)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailnew.nyi.internal (Postfix) with ESMTP id 66A0D5802F1;
 Tue,  9 Nov 2021 03:27:12 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Tue, 09 Nov 2021 03:27:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm2; bh=
 fXHFkp4en9xm1Rwc8boWh1YfwvtVV8+bfFlX1ASEYtk=; b=L7f7j0EfmxiacIVY
 bdtccmZ84BQgnbXKOXfM4+llTm7A6FaBU40QG5yoAe/9H6SiGlLKmmP/BWq8C8xC
 5tVY1yX25DahdhcOy7bpNMvYGtCOIIYhKMZ7HbGMNH9g8vtnyJwdEaPf9HY6CF0K
 1WWIIQK7g4IQjzipNZKweocHKuhaCMQTfwQ8fOStg2MmDYlRbr7kJR3xkXuyOs22
 kjYoVc95zjmpF6mjiT474qT6ohxHzXxqACdXg1gRrRfr0vvaQv93nzNk5D96eNS+
 uG90hiDR+nkJTs2GyvOt1L11IugZtcCHUBzTjl/+YHsPb0FBwjxs0GlIO/dpC0f+
 0mqGXA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=fXHFkp4en9xm1Rwc8boWh1YfwvtVV8+bfFlX1ASEY
 tk=; b=iCniJ/JN/i4E8MnD+zskSAPCYgwYp81+YU2uyRsQXrolAkBWAK8XoTGCG
 VCpPNCeYlqBzI6BWyCCIUVxmIsAxkySdkYLKVRl71WOiItHNpuAW692FUGaFyFXj
 Af334Xs0G7Q9xEN+L11oZ2su2xTZhcvk76rO0zUJVIcjBAj3oVVHzL3+zIOHCR3t
 V3WzkM/rOwadnsZnpmV7nxEcfhWpE5e/6r91yHJ4efurbV4s3LnU7bIsvBYzxHsu
 SLlbermuN4pFuTdGU24iKqhE/N8q7lP2SQMwVlhpq/o5atcPjbHTe5S+JbFCjMxy
 mdkU9poebHZNHwFcFw3J+g5do9x6Q==
X-ME-Sender: <xms:3zCKYfwEcxuyO4jwhg-uBJRAZt7KAG4I0nK9mcD465JFOxRDlcAzFQ>
 <xme:3zCKYXSjuW6JoqAotp3rW1b3qidsk0BY6RebF9zw9H0WkrRMSzGaa0K1_3KAeM_dN
 xr9y-sqD3VFd5J_eg>
X-ME-Received: <xmr:3zCKYZUoNSwq-sp366mIaiTjEpvvvxVli9EAkVlBAQhocxhmibJ6CeTHhai8HZLIbk_xVMBONgMSZu75JyvyN3vo-A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefgdduudegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu
 ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:3zCKYZiRV3kfFZP3a7ODT7FZzvMOUv_M2Fin8c1k6OxXHQy0gYvpKQ>
 <xmx:3zCKYRBSe5uayzx6CqzEcxrZ896wpcv0eIQS61RlFxajJIKcPuc0IQ>
 <xmx:3zCKYSLt4gahzucPSd406QuL8ccvHbQR_y6onjb2npMX3Oy082vtBQ>
 <xmx:4DCKYV6ImjD-u4Tb2Aeq0NNXZVoSUVv4EdWkuaPfokojRGv8teJ4ng>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 9 Nov 2021 03:27:10 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>
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
Date: Tue, 09 Nov 2021 09:27:09 +0100
Message-ID: <6965604.4qUlQkvJ3b@thomas>
In-Reply-To: <20211109015923.GB12569@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>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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 <navasile@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.

>   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