From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 39BFDA6A for ; Thu, 30 Jun 2016 15:43:54 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id r201so119483060wme.1 for ; Thu, 30 Jun 2016 06:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=jYJtn3Wp83ti1vKBZaeAoXDjsgpAdAVzonn+ndcE4qo=; b=pCaI0XnqWFr9+yLXd4TvrgPtrhhhAodjIHIzBxCegvwfogNmVXmLyBctihaWLkbXb8 axCDmFmySoAytC1BXr9OeOqlj9HpiahtkOAdwTdwxHeUdGn57nsMw3G+fIQAMfdt3GUW p8+9gRpQzQHw4oEyT3vfC64NFAkVB6gpBtbymNfVnwmuaGPYEiv9GUQhLI+rbfCtW6Ii afWGklliPxwqA6wrZkmiRVDk1SOWI1zYXUTSqBoYy5wueP+AKbxxE6gWbg8y6BXWaJ6v yu1mEiefaD3diw5NeTM2gYx4Id6+og+1yDSNllCNZM07lAT4RT3QCyElD1WaNy0Sy23B se4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=jYJtn3Wp83ti1vKBZaeAoXDjsgpAdAVzonn+ndcE4qo=; b=FclK6mARKBPa5NDxGM2j14z3Btsmdcr+NeY5xuT55/H7G5DiQB8C3yFT01hUo1ONHx aIEcoCvWRI8JbgTNOSIzOhaDxxWJSqSF1hovAyMNYiGeJ77c6SCHo6vQKbXVGfmfgdu+ kfI+t6mfiriY6M6nfyG0YUVIHJIIruRy8Yt5+Eyx9J5E8uGNSHmu2Flwr/D3l+IKwKHg GNnfPc5H+QvNDODeeUbEhnFjAU3N+LI71dOplYp7D85PHCkXnL2UINHoB9lkZt8UHTN8 xPnBIpjBIh4r2Whw1tHgcCZ9iX5K9z0SdwgwARbVi4Y9vnyYiUO3JAqjnxYWLgsj1JFs x6ew== X-Gm-Message-State: ALyK8tLga94XMwXKUND+m+aKTjo56hPvkQJF6BbaNSfMqPltCg1hGgkBRkqxKyHfObi0oHzq X-Received: by 10.194.82.161 with SMTP id j1mr15419538wjy.65.1467294233951; Thu, 30 Jun 2016 06:43:53 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id rx9sm3713214wjc.19.2016.06.30.06.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 06:43:52 -0700 (PDT) From: Thomas Monjalon To: "Tan, Jianfeng" Cc: dev@dpdk.org, David Marchand , Panu Matilainen Date: Thu, 30 Jun 2016 15:43:48 +0200 Message-ID: <1672769.UR6W46hl4M@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <0f795ccf-838f-120e-84b2-81f69b279050@intel.com> References: <1453661393-85704-1-git-send-email-jianfeng.tan@intel.com> <0f795ccf-838f-120e-84b2-81f69b279050@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: add option --avail-cores to detect lcores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2016 13:43:54 -0000 2016-05-19 10:25, Tan, Jianfeng: > On 5/18/2016 8:46 PM, David Marchand wrote: > > On Wed, Mar 9, 2016 at 2:05 PM, Panu Matilainen wrote: > >> On 03/08/2016 07:38 PM, Tan, Jianfeng wrote: > >>> On 3/8/2016 4:54 PM, Panu Matilainen wrote: > >>>> On 03/04/2016 12:05 PM, Jianfeng Tan wrote: > >>>>> This patch adds option, --avail-cores, to use lcores which are available > >>>>> by calling pthread_getaffinity_np() to narrow down detected cores before > >>>>> parsing coremask (-c), corelist (-l), and coremap (--lcores). > >>>>> > >>>>> Test example: > >>>>> $ taskset 0xc0000 ./examples/helloworld/build/helloworld \ > >>>>> --avail-cores -m 1024 > >>>>> > >>>>> Signed-off-by: Jianfeng Tan > >>>>> Acked-by: Neil Horman > >>>> > >>>> Hmm, to me this sounds like something that should be done always so > >>>> there's no need for an option. Or if there's a chance it might do the > >>>> wrong thing in some rare circumstance then perhaps there should be a > >>>> disabler option instead? > >>> > >>> Thanks for comments. > >>> > >>> Yes, there's a use case that we cannot handle. > >>> > >>> If we make it as default, DPDK applications may fail to start, when user > >>> specifies a core in isolcpus and its parent process (say bash) has a > >>> cpuset affinity that excludes isolcpus. Originally, DPDK applications > >>> just blindly do pthread_setaffinity_np() and it always succeeds because > >>> it always has root privilege to change any cpu affinity. > >>> > >>> Now, if we do the checking in rte_eal_cpu_init(), those lcores will be > >>> flagged as undetected (in my older implementation) and leads to failure. > >>> To make it correct, we would always add "taskset mask" (or other ways) > >>> before DPDK application cmd lines. > >>> > >>> How do you think? > >> > >> I still think it sounds like something that should be done by default and > >> maybe be overridable with some flag, rather than the other way around. > >> Another alternative might be detecting the cores always but if running as > >> root, override but with a warning. > >> > >> But I dont know, just wondering. To look at it from another angle: why would > >> somebody use this new --avail-cores option and in what situation, if things > >> "just work" otherwise anyway? > > +1 and I don't even see why we should have an option to disable this, > > since taskset would do the job. > > > > Looking at your special case, if the user did set an isolcpus option > > for another use, with no -c/-l, I understand the dpdk application > > won't care too much about it. > > So, this seems like somehow rude to the rest of the system and unwanted. > > The case you mentioned above is not the case I mean. But you make your > point about this one. > The case I originally mean: user sets an isolcpus option for DPDK > applications. Originally, DPDK apps would be started without any > problem. But for now, fail to start them because the required cores are > excluded before -c/-l. As per your comments following, we can add a > warning message (or should we quit on this situation?). But it indeed > has an effect on old users (they should changed to use "taskset > ./dpdk_app ..."). Do you think it's a problem? There is no activity on this patch. Jianfeng, do not hesitate to ping if needed. Should we class this patch as "changes requested"?