From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39F8D42A03 for ; Wed, 26 Apr 2023 14:31:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A882F410FA; Wed, 26 Apr 2023 14:31:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4325840DDA for ; Wed, 26 Apr 2023 14:31:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682512283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9ZbNhN7kLJg2l0XHTzclLP6p0PZNrB8wu1D6F0iPoQs=; b=CbsU2S9m7ly6pU9dIn5O5djUX8NwtEW2L8hvANS82Qj+kU86P3yiRbkZ1zVnNswG8DR+5T xi2ve1/rm75TLQ3ZncOfgwpl3zOFFzIuZPLAJNXGdjRWSkw0Fjoic7j0ZcsgBWGd+UvMlw vCLZMC94CyUrdVxyhbQBwVIBLng/Gks= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-196-Br2JfYw7MUalKzrjoKf24w-1; Wed, 26 Apr 2023 08:31:21 -0400 X-MC-Unique: Br2JfYw7MUalKzrjoKf24w-1 Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-440449636d7so5399825e0c.2 for ; Wed, 26 Apr 2023 05:31:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682512273; x=1685104273; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fGIlmb+V0jJUsx0BHFhlReeMkIF1FBLIT8/rgqzPJaY=; b=ITWjmKNLe7sOfcrjv7h7Kb3iWIB5u7gl4iBhGWWyKqc27dKk0QQpW0V2RQFvuyLuVI D6K7vrttLY9BOdTfXfj1xx4SuNNWdyy6FGofJDBrU5iHdnBovRRO6zLKqjgdIfI6t5Yw wFoClA+IjKTE5XY2QGB0EhTt/xboXFmzDfJvFyOOhVaVY+hopKM61dYxQ0iO7lKAwbaR N5wCOmIlwcKU4rivosvrnvK3Hmcwp/HZgGVDuhXe+4t2Q6NdYAkj5+uiZowR9B0AL6XN cy6MzAqIYR1vZ/J8OUbYeg++JXHWEwlHWYxNct00bWU5hXVcrY5oJ/RrW6eRa/SXBK3O kNsg== X-Gm-Message-State: AAQBX9fwgSXbdPMP2NvHKa6Ry9BaL/Dhie+8rjVvx0XkbLYDGDSa0B97 BGiykQv6FVrrMa23YJY2gyzlDmDh6ozMnu3McIVYX4ap0/tOpMXc3LHMSAl0a5nrIwJuSA9g9D6 dauB+rn9zowSv1c/yQ0WXtA== X-Received: by 2002:a05:6102:366a:b0:42e:4867:baab with SMTP id bg10-20020a056102366a00b0042e4867baabmr9130424vsb.2.1682512272917; Wed, 26 Apr 2023 05:31:12 -0700 (PDT) X-Google-Smtp-Source: AKy350b+oIGZ3E2VSwA+w8Hu63LiyvxMTxphLDLuWQabaTX2R12V7bspmq4Lp9OPjbcEhFyODxBf0sZhRFnw84IUMko= X-Received: by 2002:a05:6102:366a:b0:42e:4867:baab with SMTP id bg10-20020a056102366a00b0042e4867baabmr9130402vsb.2.1682512272564; Wed, 26 Apr 2023 05:31:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jamie Fargen Date: Wed, 26 Apr 2023 08:31:01 -0400 Message-ID: Subject: Re: quick question about core affinity To: =?UTF-8?B?7J207J6s7ZmN?= Cc: users@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000056342b05fa3c6aa5" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --00000000000056342b05fa3c6aa5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Depending on the OS there maybe other ways to accomplish core isolation, but it is documented in this page, section 7.1.3 [1]. You need to add the cores to the linux command line, In the example you have given will need to add isolcpus=3D0-2 to the linux command line. You will likely want to inspect system cores and make sure they are on the same numa node by ensuring that those cores are on the same 'physical core' and you can do that by examining /proc/cpuinfo and verifying the cores have the same 'physical id'. You can see on this system, core 0 is on numa 0 and core 1, is on numa 1, this would not be an optimal configuration, and instead it would be better to use 2,4,6 or 3,5,7. You maybe asking why cores 0,1 were omitted, and that is because some clock and timing functions of the kernel run on the first core of the physical cpu. $ cat /proc/cpuinfo | grep 'processor\|physical' processor : 0 physical id : 0 address sizes : 46 bits physical, 57 bits virtual processor : 1 physical id : 1 address sizes : 46 bits physical, 57 bits virtual processor : 2 physical id : 0 address sizes : 46 bits physical, 57 bits virtual processor : 3 physical id : 1 Aother tip is you will want the cores to be on the same path as the datapath nic. You can determine which numa node the network device is attached to by inspecting the following file for the nic you are using for the datapath. # cat /sys/class/net/eno12399/device/numa_node 0 Reference Link(s): 1 - https://doc.dpdk.org/guides-16.04/linux_gsg/nic_perf_intel_platform.html#li= nux-boot-command-line On Wed, Apr 26, 2023 at 7:38=E2=80=AFAM =EC=9D=B4=EC=9E=AC=ED=99=8D 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 o= n > 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 acces= s > 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...? > > > BR. > Jaehong Lee > --=20 Jamie Fargen Senior Engineer jfargen@redhat.com 813-580-0718 --00000000000056342b05fa3c6aa5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Depending on the OS there maybe other ways to accomplish c= ore isolation, but it is documented in this page, section=C2=A07.1.3=C2=A0[1]. You need to add= the cores to the linux command=C2=A0line,
In the example you have giv=
en will need to add isolcpus=3D0-2 to the linux command line.
You will likely want to inspect system=C2=A0cores and make sure= they are on the same numa node by ensuring that those cores are on the sam= e 'physical core' and you can do that by examining=C2=A0/proc/cpuin= fo and verifying the cores have the same 'physical id'.=C2=A0
=

You can see on this system, core 0 is on numa 0 and cor= e 1, is on numa 1, this would not be an optimal configuration, and instead = it would be better to use 2,4,6 or 3,5,7. You maybe asking why cores 0,1 we= re omitted, and that is because some clock and timing functions of the kern= el run on the first core of the physical cpu.

$ ca= t /proc/cpuinfo =C2=A0| grep 'processor\|physical'
proces= sor=09: 0
physical id=09: 0=C2=A0
address sizes=09: 46 bits physical,= 57 bits virtual
processor=09: 1
physical id=09: 1
address sizes= =09: 46 bits physical, 57 bits virtual
processor=09: 2
physical id=09= : 0
address sizes=09: 46 bits physical, 57 bits virtual
processor=09:= 3
physical id=09: 1

Aother tip is you will= want the cores to be on the same path as the datapath nic. You can determi= ne which numa node the network device is attached to by inspecting the foll= owing file for the nic you are using for the datapath.

=
# cat /sys/class/net/eno12399/device/numa_node
0


Reference Link(s):

On Wed, Apr 26, 2023 at 7:38=E2=80=AFAM =EC=9D=B4=EC=9E= =AC=ED=99=8D <l= jh890322@gmail.com> 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 co= re 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..=C2=A0

what I want was if I use cores for dpdk apps none o= ther process can access the cores.. but it seems possible..=C2=A0

I've googled to find out this but I couldn't find a= nything I wanted.
Is there anyone can explain about this...?


BR.
Jaehong Lee


--
Jamie Fargen
Senior Engineer
<= /div>
813-580-0718
--00000000000056342b05fa3c6aa5--