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 55758431A1;
	Wed, 25 Oct 2023 17:32:36 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 0369D402B3;
	Wed, 25 Oct 2023 17:32:36 +0200 (CEST)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com
 [64.147.123.21])
 by mails.dpdk.org (Postfix) with ESMTP id BC3A640273;
 Wed, 25 Oct 2023 17:32:34 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id D8F7B3200913;
 Wed, 25 Oct 2023 11:32:32 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Wed, 25 Oct 2023 11:32:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to; s=fm3; t=
 1698247952; x=1698334352; bh=+Dz1t4DkPCJJz1dB6G6jTPjmXTxbx01MP2E
 6v4ZymVw=; b=R2iOkZQkdRJ5iKW9CdVe5lAa9M1NQAHWfQ1IHsxF33pwxy20bWm
 G/Rv7qh/Fn6p96Oi0yhx+DnzQk+XD8nm76gZAx1BaLeg6G9v9PqvEKVSbqtMpxS2
 rvBrWoRhgp5SlCUtb+QzoudbrcBpxvMnY4OUUF1YObQtGvumcWOujmDE0fqHtRU8
 t4rAZ1kUJccOR5Sjv8IPqgIj5X7KtNM0ob95HxhYYnNnmgqocasR7KB2f9wUrbUE
 BTqFaYI2NmQvlznGY3Ua50HbNLX0VYDhzaJRIocZxbaOUKkj3q6bgUfTT3INfHPS
 PnDKg3zDgqISWqxayJPRThOgCnus3HOGAHA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
 1698247952; x=1698334352; bh=+Dz1t4DkPCJJz1dB6G6jTPjmXTxbx01MP2E
 6v4ZymVw=; b=uREu5gqCVJWlf3LRcZKltzjwGjNtPtquvJpj3V6PLG/r81EBk9M
 qTTJ65tbQ643U3f9uAzgYzkoJHhBYSvVApkF65HDhF/L/y8h8YX6wLCo9eHVR52A
 H9Jlq6ek3BFJzBTNKw3Syah7dwaSKSOVmBuySRFQroJ78Fr9Yj49zu+6cm00coFi
 AEzLHACwd8qSYXgSmLgJcrkjL/BJ/kUZXS/q2F3ktRHqpWESlwoojtvUdz7ccVkL
 I69OG/wTS2TtMYk9VuL+rpXowylAj6BxWwbMSg9AxweAW0gHc0hsWTVemFznn6gt
 8fl6CEoduRh3+pUeTyJXECJyERrKiqImrqg==
X-ME-Sender: <xms:DjU5ZetlctN5WdVqpJxZO0NBjovmwBzC7G_lfshKq9qFIivUVR4DNQ>
 <xme:DjU5ZTej4NW_pYJgXRyxXjR9mWIa3ap7OoI7S7JnqYvKi5Ixx8n7lMwSjImsQuKLK
 4i05dIPADw0MkZDsw>
X-ME-Received: <xmr:DjU5ZZxAXQMMwAesstLQuES9dPCcf4zmCLbx-BIqAEdvNswG_r58Ju5PVzsDnqVmGDIBBEZCDhXXmC7Gq4Pxf2rduw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrledtgdekhecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek
 gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:DjU5ZZMWdFM6AZ85XCMN0wUPbVb1GnaluvDP6s8YCODij_feMF_NPA>
 <xmx:DjU5Ze9yfVq2wbm530yM5tbf8TzNS8gTT_Ae1RgPdwLMgKsySGL3Kw>
 <xmx:DjU5ZRVG5_OavkXoWhgBrUPf6hLLlrfX5DutIWzYYx3mmSM4o3Qgkg>
 <xmx:EDU5ZZXS34eYwpXbS4sMmFNIpR513L9SBRB53nvbd3wej6lxjGJRyg>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 25 Oct 2023 11:32:29 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>,
 Bruce Richardson <bruce.richardson@intel.com>,
 Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, dev@dpdk.org,
 Morten =?ISO-8859-1?Q?Br=F8rup?= <mb@smartsharesystems.com>,
 Min Zhou <zhoumin@loongson.cn>, stable@dpdk.org,
 David Marchand <david.marchand@redhat.com>,
 Anatoly Burakov <anatoly.burakov@intel.com>,
 Narcisa Vasile <navasile@linux.microsoft.com>,
 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
 Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH] eal/unix: allow creating thread with real-time priority
Date: Wed, 25 Oct 2023 17:32:28 +0200
Message-ID: <3446453.QJadu78ljV@thomas>
In-Reply-To: <1772583.VLH7GnMWUR@thomas>
References: <20231024125416.798897-1-thomas@monjalon.net>
 <ZTkw0+uigFj0A1A2@bricha3-MOBL.ger.corp.intel.com>
 <1772583.VLH7GnMWUR@thomas>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
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

25/10/2023 17:18, Thomas Monjalon:
> 25/10/2023 17:14, Bruce Richardson:
> > On Wed, Oct 25, 2023 at 08:08:52AM -0700, Stephen Hemminger wrote:
> > > On Wed, 25 Oct 2023 15:44:25 +0200
> > > Thomas Monjalon <thomas@monjalon.net> wrote:
> > > 
> > > > > > 
> > > > > > I'll try to pass the test by adding a sleep in the test thread.
> > > > > >   
> > > > > 
> > > > > "sched_yield()" rather than sleep perhaps? Might better convey the
> > > > > intention of the call.  
> > > > 
> > > > Do we have sched_yield on Windows?
> > > 
> > > Windows has an equivalent but sched_yield() won't work here.
> > > Since the DPDK thread is still higher priority than the kernel thread,
> > > the scheduler will reschedule the DPDK thread. You need to sleep
> > > to let kthread run.
> > 
> > Interesting. Thanks for clarifying the situation.
> 
> Indeed interesting.
> I've just sent a v2 before reading this.
> 
> So I should try a v3 with a sleep.
> But then I need to find a better name than rte_thread_yield.
> Ideas?

I will go with rte_thread_yield_realtime().
Any sleep will suffice on Linux? What about a nanosleep?
I suppose Sleep(0) is OK on Windows?