DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: amit sehas <cun23@yahoo.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: core performance
Date: Mon, 30 Sep 2024 08:57:26 -0700	[thread overview]
Message-ID: <20240930085726.6df70a01@hermes.local> (raw)
In-Reply-To: <595544330.11681349.1727123476579@mail.yahoo.com>

On Mon, 23 Sep 2024 20:31:16 +0000 (UTC)
amit sehas <cun23@yahoo.com> wrote:

> We are seeing different dpdk threads (launched via rte_eal_remote_launch()), demonstrate very different performance.


Are the DPDK threads running on isolated cpus?
Are the DPDK threads doing any system calls (use strace to check)?

> 
> After placing counters all over the code, we realize that some threads are uniformly slow, in other words there is no application level issue that is throttling one thread over the other. We come to the conculsion that either the Cores on which they are running are not at the same frequency which seems doubtful or the threads are not getting a chance to execute on the cores uniformly.
> 
> It seems that isolcpus has been deprecated in recent versions of linux.
> 
> What is the recommended approach to prevent the kernel from utilizing some CPU threads, for anything other than the threads that are launched on them.

On modern Linux systems, CPU isolation can be achieved with cgroups.

> 
> Is there some API in dpdk which also helps us determine which CPU core the thread is pinned to? 
> I did not find any code in dpdk which actually performed pinning of a thread to a CPU core.

It is here in lib/eal/linux/eal.c

/* Launch threads, called at application init(). */
int
rte_eal_init(int argc, char **argv)
{
...
	RTE_LCORE_FOREACH_WORKER(i) {
...
		ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,
			&lcore_config[i].cpuset);
		if (ret != 0)
			rte_panic("Cannot set affinity\n");
	}



> 
> In our case it is more or less certain that the different threads are simply not getting the same CPU core time, as a result some are demonstrating higher throughput than the others ...
> 
> how do we fix this?

Did you get profiling info? I would start by getting flame graph using perf.



  reply	other threads:[~2024-09-30 15:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <595544330.11681349.1727123476579.ref@mail.yahoo.com>
2024-09-23 20:31 ` amit sehas
2024-09-30 15:57   ` Stephen Hemminger [this message]
2024-09-30 17:27     ` Stephen Hemminger
2024-09-30 17:31       ` amit sehas
     [not found] <1987164393.11670398.1727125003663.ref@mail.yahoo.com>
2024-09-23 20:56 ` amit sehas
2024-09-23 21:56   ` Wisam Jaddo
2024-09-23 22:17     ` Nishant Verma
2024-09-23 23:17       ` amit sehas
2024-09-24  1:14         ` Nishant Verma
     [not found]           ` <2025533199.11789856.1727143607670@mail.yahoo.com>
     [not found]             ` <CAHhCjUFjqobchJ79z0BLLRXrLZdb2QyVPM6fbji6T7jpiKLa2Q@mail.gmail.com>
2024-09-24 14:40               ` amit sehas
2024-09-24 16:38                 ` Stephen Hemminger
2024-09-24 20:47                   ` amit sehas
2024-09-26 12:32                     ` amit sehas
2024-09-26 16:56                       ` amit sehas
2024-09-26 17:03                         ` amit sehas
2024-09-27  3:03                           ` Stephen Hemminger
2024-09-27  3:13                             ` amit sehas
2024-09-27  3:23                               ` amit sehas
2024-09-24 13:25         ` Stephen Hemminger

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=20240930085726.6df70a01@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=cun23@yahoo.com \
    --cc=users@dpdk.org \
    /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).