From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 639FF2B9D for ; Thu, 29 Mar 2018 10:04:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 01:04:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,376,1517904000"; d="scan'208";a="212272115" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.35.99]) ([10.252.35.99]) by orsmga005.jf.intel.com with ESMTP; 29 Mar 2018 01:04:54 -0700 To: Olivier Matz , dev@dpdk.org References: <20171208102657.2699-1-olivier.matz@6wind.com> <20180227144630.29613-1-olivier.matz@6wind.com> <20180227144630.29613-5-olivier.matz@6wind.com> From: "Burakov, Anatoly" Message-ID: <73aaaffb-053d-b8d1-623b-a1dfdc67adc2@intel.com> Date: Thu, 29 Mar 2018 09:04:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180227144630.29613-5-olivier.matz@6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 4/4] eal: set affinity for control threads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 08:04:59 -0000 On 27-Feb-18 2:46 PM, Olivier Matz wrote: > The management threads must not bother the dataplane or service cores. > Set the affinity of these threads accordingly. > > Signed-off-by: Olivier Matz > --- <...> > > + set_affinity = 0; > + CPU_ZERO(&cpuset); > + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { > + if (eal_cpu_detected(lcore_id) && > + rte_lcore_has_role(lcore_id, ROLE_OFF)) { > + CPU_SET(lcore_id, &cpuset); > + set_affinity = 1; > + } > + } > + if (set_affinity) { > + ret = pthread_setaffinity_np(*thread, sizeof(cpuset), &cpuset); > + if (ret < 0) > + goto fail; > + } Hi Olivier, Please correct me if i'm wrong here, but if all detected cores are busy doing something (such as would be the case if DPDK is run without a coremask specified), affinity is not set? Maybe set it to master lcore instead (perhaps unconditionally - we usually recommend not using master lcore for anything important - perhaps setting it to master core always would be better, instead of trying to find unused lcores)? -- Thanks, Anatoly