From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6B382288C; Wed, 20 Feb 2019 17:01:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2019 08:01:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,391,1544515200"; d="scan'208";a="125896102" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.110]) ([10.237.220.110]) by fmsmga008.fm.intel.com with ESMTP; 20 Feb 2019 08:01:34 -0800 To: David Marchand , dev@dpdk.org Cc: olivier.matz@6wind.com, ktraynor@redhat.com, stable@dpdk.org References: <1550151042-9764-1-git-send-email-david.marchand@redhat.com> <1550608871-5251-1-git-send-email-david.marchand@redhat.com> <1550608871-5251-2-git-send-email-david.marchand@redhat.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 20 Feb 2019 16:01:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <1550608871-5251-2-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH v3 2/2] eal: restrict ctrl threads to startup cpu affinity X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 16:01:37 -0000 On 19-Feb-19 8:41 PM, David Marchand wrote: > Spawning the ctrl threads on anything that is not part of the eal > coremask is not that polite to the rest of the system, especially > when you took good care to pin your processes on cpu resources with > tools like taskset (linux) / cpuset (freebsd). > > Rather than introduce yet another eal options to control on which cpu > those ctrl threads are created, let's take the startup cpu affinity > as a reference and remove the eal coremask from it. > If no cpu is left, then we default to the master core. > > The cpuset is computed once at init before the original cpu affinity > is lost. > > Introduced a RTE_CPU_AND macro to abstract the differences between linux > and freebsd respective macros. > > Examples in a 4 cores FreeBSD vm: > > $ ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \ > -- -i --total-num-mbufs=2048 > > $ procstat -S 1057 > PID TID COMM TDNAME CPU CSID CPU MASK > 1057 100131 testpmd - 2 1 2 > 1057 100140 testpmd eal-intr-thread 1 1 0-1 > 1057 100141 testpmd rte_mp_handle 1 1 0-1 > 1057 100142 testpmd lcore-slave-3 3 1 3 > > $ cpuset -l 1,2,3 ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \ > -- -i --total-num-mbufs=2048 > > $ procstat -S 1061 > PID TID COMM TDNAME CPU CSID CPU MASK > 1061 100131 testpmd - 2 2 2 > 1061 100144 testpmd eal-intr-thread 1 2 1 > 1061 100145 testpmd rte_mp_handle 1 2 1 > 1061 100147 testpmd lcore-slave-3 3 2 3 > > $ cpuset -l 2,3 ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \ > -- -i --total-num-mbufs=2048 > > $ procstat -S 1065 > PID TID COMM TDNAME CPU CSID CPU MASK > 1065 100131 testpmd - 2 2 2 > 1065 100148 testpmd eal-intr-thread 2 2 2 > 1065 100149 testpmd rte_mp_handle 2 2 2 > 1065 100150 testpmd lcore-slave-3 3 2 3 > > Fixes: d651ee4919cd ("eal: set affinity for control threads") > Cc: stable@dpdk.org > Signed-off-by: David Marchand > --- Reviewed-by: Anatoly Burakov -- Thanks, Anatoly