DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Cc: "Van Haaren, Harry" <harry.van.haaren@intel.com>,
	Mattias Rönnblom <mattias.ronnblom@ericsson.com>,
	dpdk-dev <dev@dpdk.org>,
	Tomasz Piatkowski <tomasz.piatkowski@ericsson.com>,
	nd <nd@arm.com>
Subject: Re: [dpdk-dev] Retrieving lcore worker thread id
Date: Tue, 14 Jul 2020 13:51:38 -0700
Message-ID: <20200714135138.136f2a56@hermes.lan> (raw)
In-Reply-To: <DB6PR0802MB2216D42FE32A9BC0FD071A3F98610@DB6PR0802MB2216.eurprd08.prod.outlook.com>

On Tue, 14 Jul 2020 18:59:59 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:

> <snip>
> 
> > >
> > > 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.  
> This sounds similar to 'keep alive' functionality.
> 
> > >
> > > 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 guess here you mean the OS provided thread ID. Are there OS calls that provide the CPU runtime?

This might be difficult sinc thread id in Linux/glibc is intentionally and opaque value.
According to Posix the only valid way to look at it is to use return value from
pthread_create() and pthread_self().


  reply	other threads:[~2020-07-14 20:51 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 [this message]
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   ` [dpdk-dev] Retrieving lcore worker " Mattias Rönnblom

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=20200714135138.136f2a56@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=nd@arm.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git