DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Lukáš Šišmiš" <sismis@cesnet.cz>
Cc: users@dpdk.org, ljh890322@gmail.com
Subject: Re: quick question about core affinity
Date: Wed, 26 Apr 2023 09:27:16 -0700	[thread overview]
Message-ID: <20230426092716.424fbb28@hermes.local> (raw)
In-Reply-To: <704b12cf-e8a3-a3d6-5667-537cd7efe7c5@cesnet.cz>

On Wed, 26 Apr 2023 14:20:30 +0200
Lukáš Šišmiš <sismis@cesnet.cz> wrote:

> Hi,
> 
> 
> DPDK core affinity runs your application on the selected cores. But that 
> doesn't stop other applications from running on the same cores.
> 
> To get closer to your goal of really isolating the application from 
> other processes you would need to add isolcpus to your boot parameters.
> 
> That instructs the scheduler to not use the mentioned cores. After 
> booting with this parameter you could run your DPDK application and 
> scheduler would not schedule any process to the cores that DPDK 
> application would use.
> 
> However, if you run a separate application and with the taskset command 
> pin it to the cores your DPDK application uses that will still run and 
> will be in conflict with your DPDK app.
> 
> 
> Best regards,
> 
> Lukas
> 
> On 26. 04. 23 13:37, 이재홍 wrote:
> > Hello, I'm new to DPDK
> >
> > I've tried to run samples and got a query about core affinity.
> > As I understand, if a lcore has affinity to a CPU set, it will run 
> > only on the CPU set.
> > And I thought If I run a dpdk sample with core 0-2, none process can 
> > use the core (0-2). but when I try to run a simple app(not dpdk app) 
> > with taskset command, it runs on 0, 1, 2 cores..
> >
> > what I want was if I use cores for dpdk apps none other process can 
> > access the cores.. but it seems possible..
> >
> > I've googled to find out this but I couldn't find anything I wanted.
> > Is there anyone can explain about this...?

Look up "DPDK core isolation".

More detail in here: https://www.suse.com/c/cpu-isolation-introduction-part-1/

There are multiple ways to do this, the simplest one is to set the kernel
command line so that on boot the scheduler does not use the isolated cores.
The more complex one recommended for production is to use cgroups
and systemd.

You can't isolate CPU 0. It is special and used for system interrupts etc.
In general, don't use CPU 0 for DPDK applications.

There are other performance tuning considerations such as IRQ affinity,
nohz_full and rcu isolation that are also worth looking at.




  parent reply	other threads:[~2023-04-26 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 11:37 이재홍
2023-04-26 12:20 ` Lukáš Šišmiš
2023-04-26 12:26   ` 이재홍
2023-04-26 16:27   ` Stephen Hemminger [this message]
2023-04-26 12:31 ` Jamie Fargen

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=20230426092716.424fbb28@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=ljh890322@gmail.com \
    --cc=sismis@cesnet.cz \
    --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).