DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: "Van Haaren, Harry" <harry.van.haaren@intel.com>,
	dpdk-dev <dev@dpdk.org>
Cc: Tomasz Piatkowski <tomasz.piatkowski@ericsson.com>
Subject: Re: [dpdk-dev] Retrieving lcore worker thread id
Date: Wed, 15 Jul 2020 10:21:29 +0000	[thread overview]
Message-ID: <1208b4f3-f6ca-9270-5e98-a667ec3098b5@ericsson.com> (raw)
In-Reply-To: <BYAPR11MB314345496165731C1DD80B4AD7610@BYAPR11MB3143.namprd11.prod.outlook.com>

On 2020-07-14 15:08, Van Haaren, Harry wrote:
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Mattias Rönnblom
>> Sent: Tuesday, July 14, 2020 1:04 PM
>> To: dpdk-dev <dev@dpdk.org>
>> Cc: Tomasz Piatkowski <tomasz.piatkowski@ericsson.com>
>> Subject: [dpdk-dev] Retrieving lcore worker thread id
>>
>> Hi.
> Hey,
>
>> In DPDK 19.11, the lcore_config struct of <rte_lcore.h> is made private,
>> and with it the possibility to look up the thread id of the lcore worker
>> threads disappears.
>>
>> One use case is an application with a monitoring function (on some
>> control plane thread), which uses the thread ids to make sure the worker
>> threads gets the CPU runtime they should, and thus is able to detect
>> stalls.
>>
>> Is there some other way of finding out the thread_id of a lcore worker
>> thread? All I can think of are hacks like using a temporary service
>> function for service cores, in combination with requiring launched
>> application threads also to store their thread id in some global
>> structure (index by lcore_id).
> -1 for the service cores idea. I like the creative solution thinking,
> but not as a long-term solution.
>
>> Is there some cleaner way? If not, would adding something like a
>> rte_lcore_thread_id() function make sense?
> I think given your use-case description above, this makes sense.
> I guess it comes down to a discussion around if thread_id should
> be exposed at all - but given you have a use I'd argue yes it should.
> Doing so in a cross-platform way might be a bit tricky though.
>

With the Windows port ongoing, I guess that's a valid concern. 
<rte_lcore.h> already is a heavy user of pthread ids though. Maybe you 
would leave that change to a later patch, which would typedef the whole 
thing into something DPDK specific and portable.


Regards,

     Mattias


      parent reply	other threads:[~2020-07-15 10:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 12:03 Mattias Rönnblom
2020-07-14 13:08 ` Van Haaren, Harry
2020-07-14 18:59   ` Honnappa Nagarahalli
2020-07-14 20:51     ` Stephen Hemminger
2020-07-15 10:17       ` Mattias Rönnblom
2020-07-15 16:21         ` Stephen Hemminger
2020-07-16 10:20           ` Mattias Rönnblom
2020-08-10  9:36             ` [dpdk-dev] [RFC] eal: introduce function to get lcore " Mattias Rönnblom
2020-10-20 13:38               ` David Marchand
2020-10-20 18:40                 ` Mattias Rönnblom
2020-07-15 10:21   ` Mattias Rönnblom [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1208b4f3-f6ca-9270-5e98-a667ec3098b5@ericsson.com \
    --to=mattias.ronnblom@ericsson.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=tomasz.piatkowski@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).