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 5F03642A07 for ; Wed, 26 Apr 2023 18:27:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDF0F410FA; Wed, 26 Apr 2023 18:27:20 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 19B164068E for ; Wed, 26 Apr 2023 18:27:20 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1a50cb65c92so58354705ad.0 for ; Wed, 26 Apr 2023 09:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1682526439; x=1685118439; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=jz8CyVLMOpIUF9J5kOIeiIHURYz0shNCB2h1i59pde0=; b=Wi6s0QwLFgLKDqQJBPM474IPCbCry24MY8msYoQF0ITEcXstxHjI2C4BVSHB/VBS8U ju7ybuknAl4h/iW3a/lnP221iyHN7WI05rXMZ+r9eie57vSUbGNyM9cuK6wwt6wGf50S zFRHv+dSZbbNcTPBq3XJgwn6xd8iX/eN4srrXpRotcfxcw1Wvfyo/3H6gb8rjTkmqLpf HwdS6hGZ6PwDsDwWjjWQs0jQx4fBU1dzR3eyy2iuIS6/FZuHatCQVCEbYtHWcl9ZvuEx 8FpL/VL3QNNMyw6jWDot9N6rgGvqYO15Hi3L+F7yEYMd40h/l5iW1ZS8idNFQGTVW4jq DhfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682526439; x=1685118439; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jz8CyVLMOpIUF9J5kOIeiIHURYz0shNCB2h1i59pde0=; b=fQoiRYcMuw4rNS9XjYQsCrHKKdBU4IqipDIaUM4EBYyhCSa5XF52SCNzQKksIKUXy6 XEEQhchBCgYbUhJ9nFtrwsUein+r1Qq5YobPGjA8butdXW9UhqiEfs6i+bn4e3Y49TSr b7N8uD5Iz3GLR7w0I/0Eqn/9X3sHiqTXrj9dqES9vVCJ4hNDwqraCtfCJ3hyomuXMfpl nGTVSj0iUi7hhmZHT6Co454lU9+RRqIAH0dmzzXJzD8Fe5ZORiRwUKX41KIJGisVaHfr LVl+21DdgTOm7R5XUbhDVRBuMBLh1jQm6hFJDqXzuV4zTI/ECKwj+nTUb8fVb8ofVYn9 lLZg== X-Gm-Message-State: AAQBX9fvbwKzD5YjTrLoPVKfMa3hLHZY37S12GLXsbtkd3efZEU4fQfD xIOXDs1zvzCb1TFlI4X0yr2dsg== X-Google-Smtp-Source: AKy350ZJXELASwxjUDJUwVrnCkGSF2kxlp70ZVQIq/hVlssNLb/1TsNIi3DYk+C7U4beXC/wOS0JhA== X-Received: by 2002:a17:902:d510:b0:1a9:631b:7d68 with SMTP id b16-20020a170902d51000b001a9631b7d68mr17484675plg.8.1682526439147; Wed, 26 Apr 2023 09:27:19 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id je4-20020a170903264400b001a217a7a11csm10157661plb.131.2023.04.26.09.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 09:27:18 -0700 (PDT) Date: Wed, 26 Apr 2023 09:27:16 -0700 From: Stephen Hemminger To: =?UTF-8?B?THVrw6HFoSDFoGnFoW1pxaE=?= Cc: users@dpdk.org, ljh890322@gmail.com Subject: Re: quick question about core affinity Message-ID: <20230426092716.424fbb28@hermes.local> In-Reply-To: <704b12cf-e8a3-a3d6-5667-537cd7efe7c5@cesnet.cz> References: <704b12cf-e8a3-a3d6-5667-537cd7efe7c5@cesnet.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Wed, 26 Apr 2023 14:20:30 +0200 Luk=C3=A1=C5=A1 =C5=A0i=C5=A1mi=C5=A1 wrote: > Hi, >=20 >=20 > DPDK core affinity runs your application on the selected cores. But that= =20 > doesn't stop other applications from running on the same cores. >=20 > To get closer to your goal of really isolating the application from=20 > other processes you would need to add isolcpus to your boot parameters. >=20 > That instructs the scheduler to not use the mentioned cores. After=20 > booting with this parameter you could run your DPDK application and=20 > scheduler would not schedule any process to the cores that DPDK=20 > application would use. >=20 > However, if you run a separate application and with the taskset command=20 > pin it to the cores your DPDK application uses that will still run and=20 > will be in conflict with your DPDK app. >=20 >=20 > Best regards, >=20 > Lukas >=20 > On 26. 04. 23 13:37, =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=20 > > only on the CPU set. > > And I thought If I run a dpdk sample with core 0-2, none process can=20 > > use the core (0-2). but when I try to run a simple app(not dpdk app)=20 > > 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=20 > > 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.